Author |
Message
|
Chittiprasad |
Posted: Thu Feb 16, 2006 10:17 am Post subject: Storing messages in circular fashion |
|
|
Newbie
Joined: 16 Feb 2006 Posts: 4
|
Greetings !!!
Here is the scenario.
We have a Queue called "AQ". Our java Application listens this queue and drains as they arrive. Sometimes, we are loosing some messages during this process.
Is there any way that I can copy these messages to a Temporary queue "TQ" in circular fashion. So that, when something went wrong on AQ, we should be able to recover messages from TQ.
I would like to give limited current depth for this TQ (say 10000), just to save most recent messages only.
Also, when problem occurs, how can we achieve avoiding duplicate messages from processing ?
OR
Is there any other approach to recover messages before they lost.
Thanks in advance,
- Chitti. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Feb 16, 2006 10:37 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You can use the mirrorq exit, and put messages to TQ with an expiration time on them.
Or you can put a process in from of AQ that will insert messages into a database and then output them to AQ. And write some sort of webpage that will allow you to search these messages and put one out to AQ again from the database. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Chittiprasad |
Posted: Thu Feb 16, 2006 11:48 am Post subject: |
|
|
Newbie
Joined: 16 Feb 2006 Posts: 4
|
Thanks for the quick response Jeff.
With the first approach, do you think, I can differentiate processed messages against not processed ? Is there any automated way of checking or I have to check manually. Please accept my ignorance.
Thank You. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Feb 16, 2006 11:57 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You would have to check manually.
The best bet is to change the application that consumes messages on AQ to use syncpoint and the BackoutThreshold and BackoutRequeue properties. Then it would put messages that it had errors with onto TQ directly (as an error queue rather than a temporary queue). And it also would only completely remove a message from AQ when it had processed the messages successfully. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
vennela |
Posted: Thu Feb 16, 2006 12:01 pm Post subject: Re: Storing messages in circular fashion |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Chittiprasad wrote: |
Sometimes, we are loosing some messages during this process.
- Chitti. |
If I were you, I would take a step back and see why the messages are lost.
MQ will not lose it, unless you have some incorrect configuration.
If your application is losing them revisit your application. There are lot of features in both MQ and Java for transactional processing.
Your idea of copying all the messages to another queue because you are losing some and wanting MQ to tell you what messages your app has lost is something that doesn't seem correct. |
|
Back to top |
|
 |
wschutz |
Posted: Thu Feb 16, 2006 12:09 pm Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
You might want to read up on "MQGMO_SYNCPOINT" in the programmer's guide / reference ..... that can help you from loosing messages .... _________________ -wayne |
|
Back to top |
|
 |
Chittiprasad |
Posted: Thu Feb 16, 2006 12:21 pm Post subject: |
|
|
Newbie
Joined: 16 Feb 2006 Posts: 4
|
Thank you everyone. I will take your suggestions and double check our code before I take any action.
Chitti. |
|
Back to top |
|
 |
|