Question

Quoting from EIP patterns book from Hohpe G. and Woolf B. :

Note that in JMS, an Event-Driven Consumer that is also a Transactional Client will not work as expected. Normally a transaction is rolled back when the code in the transaction throws an exception, but the MessageListener.onMessage signiture does not provide for an exception being thrown (such as JMSException), and a runtime exception is considered programmer error. If a runtime exception occurs, the JMS provider responds by delivering the next message, so the message that caused the exception is lost.To successfully achieve transaction, event-driven behavior, use a message-driven EJB.

I understand that, but what if I'm using Apache NMS (ActiveMQ) from a .Net Client ? I don't have MDB so how should I adress this issue ?

Was it helpful?

Solution

The ActiveMQ NMS client async consumer functions in essentially the same way as the Java version. You should handle exceptions in you callback since they are treated as programmer error in NMS as well and the next message is delivered when in a transaction.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top