开发者

Using Camel to transparently log messages from queue

开发者 https://www.devze.com 2023-02-06 01:53 出处:网络
I have a legacy application running on Glassfish which I have just recently configured to use activemq rather than openMQ. My activemq bro开发者_开发技巧ker is running in a separate process outside of

I have a legacy application running on Glassfish which I have just recently configured to use activemq rather than openMQ. My activemq bro开发者_开发技巧ker 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.


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消