0

I have been reading on JMS, ActiveMQ and Camel.

From my understanding, if we need to integrate multiple system where integration involves only routing of messages in same format, activeMQ is sufficient else we can opt for camel.

Now incase of message redelivery expiration caused by some exception or transaction rollback, activeMQ sends the failed message to dead letter queue. We are not using Apache camel as activeMQ is sufficient for our requirements but should I opt for camel if I want to monitor and audit the failed messages or will it add an overhead ? I have not used camel before so if someone can direct me how to monitor dead letter messages. We are thinking of having dead letter queue for each of our topic or queue and provide audit logs for client.

Gautam Tadigoppula
  • 932
  • 11
  • 13

1 Answers1

3

Depends. What do you want to do with DLQ messages? How many errors do you anticipate?

If the error rate is very low and it's hard to predict what to do with errors, maybe some alert could trigger a human to look at the DLQ message on DLQ to figure out what to do with it. Retry? File a bug report? Call someone?

To monitor DLQs you could use JMX or it's http equivalent, Jolokia, to monitor the queues and send an alert if the queue size is more than zero.

You can of course use Apache Camel to somehow process the dead message. Like send it in an email, save it to an error reporting system or take other action to alert a user, use different logic to process the message or what not. This logic you can write in any framework, not just Apache Camel. But Camel is a decent choice.

Anyhow, there is no silver bullet for DLQ management. You must build a system that (manual or automatic) that fits your needs and limits.

Petter Nordlander
  • 22,053
  • 5
  • 50
  • 84
  • I just need to read the message from DLQ and maintain an error table. An API will be provided for this table. So as per understanding , adding camel would be an overhead for such scenario, right ? I can just read DLQ and do the thing. Can you suggest what are the best practices used for handling DLQ messages ? – Gautam Tadigoppula Aug 21 '18 at 04:46
  • Sure, but you need "something" to read this Error queue and post to error table, right? That something can be Camel if you do not have something else running, already configured. Camel reduces boiler plate code to connect, handle errors etc. if you need to write something from scratch. One thing with DLQ messages - they have a "retry" option in ActiveMQ. So if the error depends on, say an offline DB, you might want to trigger a "retry" some time later (or when a technican decides to do so). That "retry" can be triggered via JMX, HTTP/Jolokia or in Web Console. – Petter Nordlander Aug 21 '18 at 08:11
  • So our team decided to have a listener for DLQ and audit the error messages.We have microservices in place with 5 nodes dealing with respective services and communicating via activemq in JSON format. I am trying to understand, I am doing all the communication with spring jmstemplate, would camel ease the communication among all servers including failure messages or it would be an overkill ? I might be asking a lot, but I am really confused where would camel fit if the mode of communication is same among all nodes (JSON) – Gautam Tadigoppula Aug 24 '18 at 22:49