activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uromahn <>
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:
Sent from the ActiveMQ - User mailing list archive at

View raw message