I am trying to develop a multi-threaded activemq consumer.
The messages get processed in multiple threads.
Is it possible to rollback message for a particular thread in case of some exception or failure?
I am looking into session.rollback() and session.commit() but if i call these methods how will i make sure that a particular message gets rolled back?
I am also open if i can selectively commit some message.
Thanks in advance.
Regards,
Aeijit
it depends on where your transaction boundaries are set. generally, each thread will have its own transaction and will commit/rollback all messages in its transaction.
another option is to just use the general exception/retry/DLQ strategies to handle individual message failures, this is easier and meets most requirements