Kyle
Kyle

Reputation: 3885

Using Camel to transparently log messages from queue

I have a legacy application running on Glassfish which I have just recently configured to use activemq rather than openMQ. My activemq broker is running in a separate process outside of glassfish. I was thinking it would be nice to configure a camel route that logs messages as they are sent to the queue. I want to do something like this

from("activemq:myqueue") .to("activemq:myqueue") .wireTap("direct:tap") .to("log:myqueue");

I don't think that makes sense though. What I want to happen is for camel to log the message transparently to the consumer. I don't want to have to change code so that the producer sends to an "inbound" queue and the consumer receives from an "outbound" queue and camel hooks them up, since that would require changes to the legacy app. I don't think this is possible, but just wondering.

Upvotes: 1

Views: 1691

Answers (2)

Claus Ibsen
Claus Ibsen

Reputation: 55525

Yeah I was about to suggest looking for a broker solution as it would be the most optimized and performant. Obvious monitoring the message flow in the broker is a common requirement and thus ActiveMQ has features for that: http://activemq.apache.org/mirrored-queues.html

Upvotes: 4

Kyle
Kyle

Reputation: 3885

I think I just found out how I can do what I want with mirrored Queues:

http://activemq.apache.org/mirrored-queues.html

This is a change to the broker, and not purely done in camel.

Upvotes: 0

Related Questions