Author |
Message
|
bindu |
Posted: Thu Sep 27, 2007 9:59 pm Post subject: Copy message into another queue |
|
|
Voyager
Joined: 07 May 2004 Posts: 97
|
Hi,
I need to copy the exact message into another queue i.e. from Queue A to Queue B. This needs to happens before the MDB picks up the message from Queue A online. Could any one help me how to do this one because i need to keep copy of all messages that came into Queue A. Instead of this one is there any other way to make a copy of all messages that came to Queue A entire day.
Thanks in advance.
Bindu |
|
Back to top |
|
 |
Vitor |
Posted: Thu Sep 27, 2007 11:05 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Look up the mirrorq exit.
Note that this is a sample exit, is not intended to be production strength and a problem with an exit can cause all sorts of issues.
You're far better getting whatever's writing into Queue A to write a second copy into Queue B, or get whatever's reading Queue A to write into Queue B or other audit location. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Sep 28, 2007 2:35 am Post subject: Re: Copy message into another queue |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
bindu wrote: |
Hi,
I need to copy the exact message into another queue i.e. from Queue A to Queue B. This needs to happens before the MDB picks up the message from Queue A online. Could any one help me how to do this one because i need to keep copy of all messages that came into Queue A. Instead of this one is there any other way to make a copy of all messages that came to Queue A entire day.
Thanks in advance.
Bindu |
The MDB should log the message into a DB. Then you have the exact copy of what was processed. If the sending app does the same after sending the message you can even correlate by messageId and find out if messages where lost in transit (expiration, channel problems on non persistent messages etc...).
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
JuulV |
Posted: Fri Sep 28, 2007 7:34 am Post subject: |
|
|
 Apprentice
Joined: 05 Sep 2007 Posts: 28 Location: Belgium
|
There are a few ways to achieve this:
_ you can have the application write in double, but you probably don't want to go this way
_ you can write an "API wrapper" to do this
_ you can use the API Exit; the sample program "mirrorq" can help you here
_ if the messages are persistent, they're also written to the WMQ recovery log
I know that we shouldn't make any "commercial" statements, but Cressida Technology has products that can help you with using either the API Exit method, or the Recovery log method _________________ Juul Vanparijs
Senior Developer
Cressida Technology Ltd |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Sep 28, 2007 7:42 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You can also change where the application RECEIVING the message is reading from, and put an app that reads from the original queue, and writes to the new queue and a backout queue.
More straightforward than messing around with mirrorq, and just as transparent to the sending application.
I've never used any Cressida products, so I can't comment on the value of that. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
bindu |
Posted: Fri Sep 28, 2007 9:12 am Post subject: Copy message into another queue |
|
|
Voyager
Joined: 07 May 2004 Posts: 97
|
Hi All,
Thanks alot for your valueble suggestions. Here actually the application is already in production and client doesnt want to redeploy again means no changes in application side. The mail problem is here MQ is getting messages from different client and MDB is picking those and sending to DB and receiving from response from DB on backend side sometimes it takes more time nearly 30min to get response from backend so in the mean time on MQ side queue A is filling out so they just want to know which message its taking more time and then they will ask the developer to make changes on the front end application team related that particular request. To find out which message get strucked in process i plan to implement this scenario. Could you please let me know is it the right way am i handling the scenario or not. Please post your suggestions based on scenario.
Thanks in Advance,
Bindu |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Sep 28, 2007 7:40 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
This can be handled in a myriad of different ways:
- By having a timed request / reply process with the left overs being analyzed and handled ...
- By running a complete asynchronous model... The reply gets send to an MDB that just logs to a DB. If and when the message is needed it gets extracted from the DB...
- By running any combination of the afore mentioned
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jefflowrey |
Posted: Sat Sep 29, 2007 5:15 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I'd think it would be easiest to configure the MDB to run multiple instances... so that if one message is causing a delay, then other copies of the MDB can process the messages on the queue...
And, of course, have the MDB log some information about what message it's trying to process, so you can tell when a particular instance of an MDB hasn't processed a new message in a while, and which message it is currently trying to process.
It's going to be very difficult to tell which message on a mirrored queue is the one that's causing the trouble.
I also think it would be easy for the sending application to log an exception when it hasn't received a reply - and then save out the message it didn't receive a reply for. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|