I've a JMS Topic that produces a unique messages.
And I have a simple webapp deployed on n machines (clients), All what it do is to put the consumed msg into another system (the destination system).
Note:
- I do NOT have control on the JMS.
- I DO have control on the Clients.
- I do NOT have control on the destination system that will receive the msg by the client.
My Question is:
How to make sure that the message written once (into the destination system) by one of these clients and never being written again by another client (as if the JMS was a Queue not topic), knowing that each msg have a uniqueId?
I am thinking of two solutions:
create another JMS Queue that consumes from that topic, and this queue is gonna consumed by one of the n clients once for each msg.
Have some sort of shared location (memcache) that have the message Ids for consumed msgs, and before send the consumed msg to destination system by the client, I'll have to check if the shared storage (memcache) have this id before, if not then send to destination system.
What do you think?
Update:
The system that eventually got the message is not a RDBMS and is not even under my control. I just deliver some msg from one system to another. (actually it is Apache Flume by is not under my control)