Вопрос

We are working on a component which integrate two systems. Both system are communicating using a message bus(Service Bus and ActiveMQ) and they both produce messages. These messages contain critical data that cannot be lost during transport.

Our component is using Apache Camel for integrating these two systems. If we use "default" messaging principles then Apache Camel consumes a message from one bus, processes it and then forwards it to another queue. However, our client is concerned that this leads to a risk of the message beeing lost in transport and that responsability for the message is passed from system to system. A suggestion from our client was to leave the message in the senders queue until we can confirm that it has been received in the other system. I feel that this solution introduces a whole new complexity to our system and might not be optimal since we face a risk of messages getting stuck on queues.

Is there a best practice for dealing with this situation?

Это было полезно?

Решение

use JMS transactions, this will guarantee that a message isn't removed from a queue until it has been successfully received by a client...

see http://camel.apache.org/transactional-client.html

also http://tmielke.blogspot.com/2012/03/camel-jms-with-transactions-lessons.html

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top