views:

1296

answers:

2

Hi,

do you have idea, if there would be some nice way to browse/log JMS queues? (I'm using OpenJMS)

For topics I can just add one consumer more and that's about it but with queues I haven't finished with a solution yet. I would like to log all the messages in certain queues and topics without "popping" them from the queue (so that the logger counld browse queues "invisible").

With javax.jms.QueueBrowser i can get a snapshot of the queues but that doesn't seem to provide "listener solution" - reading all the messages on the queues on infinite loop again and again and hoping that no messages happen to be both written and consumed before my snapshots - that didn't sound like a good solution.

Another option would be to create two queues for each "logical queue" - one for logger and one for the actual use - logger would then forward the messages to the "actual queue" - that could maybe work but there could be better solution?

So if somebody has a solution to get all messages in a queue by an "invisible" logger or some nice other solution for the logging, that'd be cool.

+2  A: 

If you switch to Apache ActiveMQ (which is a much better & more popular open source JMS provider which also fully supports JMS 1.1 and J2EE 1.4) you get a number of alternatives for monitoring and browsing queues in particular you can just use the Web Console or JMX

James Strachan
Even though for this particular case this wasn't possible (study assignment with JMS implementation restriction), in general ActiveMQ seems to be better choise, thanks.
Touko
+1 for AMQ. I've used it extensively and love it.
Kyle Hodgson
+1  A: 

I was also looking for a solution and I came across an OSS project called Hermes (http://www.hermesjms.com/confluence/display/HJMS/Home). I cannot vouch for it, but I am going to be trying it out. The home page makes mention of the ability to browse / search queues.