If there are multiple consumers, having each consumer reject out-of-order messages as Art suggested is only going to work if you use message groups, so take his last paragraph as good general advice but ignore it if you choose to implement the rest of his suggestions.
But if you're using message groups, you can just keep a list of the entities for which your initial message failed, and check each new message against that blacklist. You'll have to decide whether you need persistence of that information across consumer restarts and message groups being handed to another consumer (use a database or some other persistent store instead of an in-memory list), how long an entity should be kept in the blacklist, and whether blacklisting should happen only for a failure on the first message about an entity or on any failure. Good luck. On Sep 11, 2015 10:42 PM, "artnaseef" <a...@artnaseef.com> wrote: > Hey Rosy - ActiveMQ is a messaging solution, primarily focused on getting > messages from producers to consumers. Advanced logic of that type really > belongs in an application. There's no straight-forward way to add that to > ActiveMQ itself, and it would be difficult to diagnose if such > functionality > didn't work perfectly. > > I would look at the processing of the messages and find a way within the > application to detect when processing of a message should not continue due > to a prior, related message failing. If the messages do not have sequence > numbers on them, it would be very simple to add a processor (e.g. using > camel) that reads the messages and assigns incremental sequence numbers to > each message in the same steam (e.g. message 1, 2, and 3 for > student_1000). > Then the application can track the last successful update for each student > and reject updates that are out-of-sequence. > > Actually, even JMS Groups aren't the best messaging pattern; they sound > like > a good idea, but in practice JMS Groups can create a lot of problems. > Idempotent processing is the gold-standard enabling fully competing > consumers and true horizontal scaling. > > Hope this helps. > > > > > -- > View this message in context: > http://activemq.2283324.n4.nabble.com/ActiveMQ-broker-automatically-move-messages-with-same-JMSXGroupID-to-DLQ-tp4685943p4701948.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. >