views:

61

answers:

2

I have a .NET application that needs to monitor a queue in WebSphere MQ. I need to react to each message without impacting the current process. The client application can't explicity send me the same message.

Can I read a message without removing it from the queue? Can I be notified for each message? Can I configure the MQ to duplicate the current queue?

Is there another solution?

A: 

You could change from using a queue to a durable topic and have both your reader and your browser subscribe to it.

You could also create a distribution list on your queue manager. A distribution list is used to send a copy of the same message to multiple queues. You would then have a processing queue and a browsing/monitoring queue.

gwhitake
If I just browse the messages, the current listener can read (and remove the message) before a browse?I plan to use XMS.
Jorge
You're right. I edited my response.
gwhitake
+1  A: 

If you are using WMQ v7 then you can do this without any impact to the existing applications other than to change the queue name for one of them.

Currently the message producer and consumer use the same queue. In v7 of WMQ you can create an alias over a topic so that the message producer thinks it's a queue. Then you can create two administrative, durable subscriptions such that one points to the existing input queue and another points to a queue dedicated to your new application.

Of course you are already using v7 since v6 goes out of service next year, right? You can upgrade the QMgr to v7 which enables this behavior while still using v6 client code for the apps.

If you are using WMQ v6 then the MirrorQ program might work for you.

T.Rob
Thanks. You've completed the answer from gwhitake.
Jorge