I'm new to the microservices field. I'm looking for the right approaches regarding how to deal with the challenge of redundancy of a pus-sub application. Assume my application has has the below constrains:
- Real time (very critical)
- Heavy load time
- Lots of events
- Events are metrics (like temperature, stock prices, etc.)
In order to avoid down time, I need probably to instantiate another copy of my application.
Now, if the replication step is right - What should be the strategy for the events replication? Means, if I'm holding 2 instances of the same application, they both publishing the same data.
I can think of 2 approaches:
- Publisher level
- Consumer level
Publisher level
Publisher should know that currently he's in isActive=false
status.
But, I think it's not the right way.
Why?
Since the publisher may not be aware of its environment. It sounds that it's not a natural part of its responsibility.
Who can tell what's the instance
isActive
status?
Consumer Level
I'll configure something (if possible...) that I'll ignore the same message if it comes again. But it looks me too problematic. Why?
- That means my queue (Rabbit) gets twice the same messages. If I have very intensive stream of messages that can lead to a performance issue (IMO).
I'm looking for the standard approaches in this challenge. Reading material is welcomed too.
isAlive
API? Who is responsible for the monitoring? There is a component which this is its responsibility? Thanks!