I have created a java class which using changestream api of mongodb and able to get notification of changes happening in mongodb collection. We need to process this notification data to process the business logic.
I have deployed this java class in the cloud environment where we have four instances of this java class running. Now after testing i found that these four instances are getting same data.
can anybody suggest me how to get the notification data in all the servers and no two servers will get the same data.
Please help on this.
My java code copied below printing same data in all the servers.
I am not a spy. Definitely. Definitely not a spy. Not me. No way. But this tiny ad ...
a bit of art, as a gift, that will fit in a stocking