문제

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 ?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top