Hawin
Hawin

Reputation: 11

IBM MQ Message copy to a new queue

I have requirement to copy the message in real time from one queue to another for a specific period of time. How can we configure this ? Manual switch is possible with IBM MQ. use case is like .. My primary queue connected to primary application. when primary application goes down i need to process the data through secondary application using a secondary queue. once primary application is up , then it will pick the data from primary queue and re process it .

So here the MQ switch should replicate/copy the data from primary to secondary queue in the down time. so that secondary app can do the processing.

I have gone through the docs and understand that replication is possible but not sure how to do with manual switch (ON / OFF) for a specific period.

Appreciate your help.

Upvotes: 1

Views: 1151

Answers (1)

Roger
Roger

Reputation: 7506

What you are asking is for MQ to know about your application infrastructure. That's not possible.

Solution #1:

Why don't you copy/replicate all messages to a secondary queue, then have your secondary application ONLY process messages IF the IPPROCS of the primary queue is ZERO. As soon as IPPROCS of the primary queue is NOT zero then discard messages in the secondary queue.

Solution #2:

Create a third application that monitors the IPPROCS of the primary queue. When it is ZERO, start copying the messages to the secondary queue. Note: When the third application has the primary queue opened, IPPROCS wiil be 1. Hence, when the IPPROCS of the primary queue is 2 (or greater) then stop copying the messages and close the primary queue.

Solution #3:

Would involve a 3rd party solution. You could use MQ Message Replication (MQMR) to copy/replicate the messages in the primary queue to the secondary queue. Configure MQMR as needed but set it to inactive. When the primary application goes down/offline then immediately change MQMR to active. When the primary application is up and running again switch MQMR back to inactive.

Solution 4:

This solution is a combination of solution #1 and #3. Use MQMR to copy/replicate all messages in the primary queue to the secondary queue. Have your secondary application ONLY process messages IF the IPPROCS of the primary queue is ZERO. As soon as IPPROCS of the primary queue is NOT zero then discard messages in the secondary queue.

Upvotes: 2

Related Questions