activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uromahn <ulr...@ulrichromahn.net>
Subject Re: preventing duplicate messages that perform the same action?
Date Tue, 21 Oct 2014 08:30:56 GMT
As tbain98 correctly said, this is application logic.

The best approach is to implement the processing logic within the receiver
of the message as an idempotent service, i.e. if you perform the same action
twice, it won't change your application state again.

One possible solution could be to have a unique txn-id as part of your
message and the processing service will persist the txn-id. Now, in case you
receive the same txn-id again, your logic will know that it already
processed it and can safely discard the message as a duplicate.
There are other approaches and solutions, e.g. using a distributed cache to
hold txn-id for a certain period of time, etc. All of that highly depends on
your very specific use cases so you will have to look at your overall
architecture and decide for yourself.



--
View this message in context: http://activemq.2283324.n4.nabble.com/preventing-duplicate-messages-that-perform-the-same-action-tp4686571p4686577.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message