I'm using micro services, suppose I have 3 services and they all are connected to each other through a JGroup UDP channel (JGroups can broadcast messages between them):
--- --- ---
| A | --msg--> | B || C |
--- --- ---
If I have just one instance of each service, everything in fine. But for example, if I have two instances of service C
, both of them will receive the event and both of them will run their own procedure and the result would be duplicated in the database (sum the value two times).
--- --- --- ---
| A | --msg--> | B || C || C |
--- --- --- ---
Is there any way to manage this?