Author |
Message
|
rparti |
Posted: Tue Jun 19, 2007 6:56 am Post subject: Backout message processing |
|
|
 Voyager
Joined: 05 Oct 2005 Posts: 86 Location: U.S.A.
|
Consider a queue Q1 defined with a backout threshold say 5 and a backout queue BOQ
Q1 has say 'x' messages, x>1
The first message is a poison message that will be backed out and eventually move to the backout queue when backout count reaches 5
The question is, "Will the other messages be processed at all till the first message is thrown to the backout queue"
That is....the first message is backed out and thrown back to Q1....this happens 5 times before it is thrown in BOQ. Will message 2 ever be processed till the first message is in BOQ? |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jun 19, 2007 6:59 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
MQ is a first-in, first-out system. An MQGET always returns the first available message on the queue that matches the options specified on the GET.
Under what conditions would message #2 be returned? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jun 19, 2007 7:10 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
jefflowrey wrote: |
MQ is a first-in, first-out system. An MQGET always returns the first available message on the queue that matches the options specified on the GET.
Under what conditions would message #2 be returned? |
If there are 2 processes reading the queue FIFO and the poison message is being processed when the 2nd process does a get?
If the queue is priority based and the 2nd message has a higher priority? Though I accept in this case the next message to arrive after the poison message is not the 2nd one in the strict sense of the queue once it's arrived. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
rparti |
Posted: Tue Jun 19, 2007 7:16 am Post subject: |
|
|
 Voyager
Joined: 05 Oct 2005 Posts: 86 Location: U.S.A.
|
All the messages fit the MQGET call.
That is all the x messages can be processed with x subsequest MQGET calls.
However, consider that message 1 is storing in its payload some event that at the current moment should not be processed. It should be processed later though.
We were thinking of putting this messsage in another queue, and retry after 15 mins, by bringing back the message to Q1.
Just to understand though, if we put back the message in Q1, by backing out, will message 2 ever be processed till message 1 is thrown to BOQ |
|
Back to top |
|
 |
rparti |
Posted: Tue Jun 19, 2007 7:18 am Post subject: |
|
|
 Voyager
Joined: 05 Oct 2005 Posts: 86 Location: U.S.A.
|
Vitor wrote: |
If there are 2 processes reading the queue FIFO and the poison message is being processed when the 2nd process does a get?
|
Consider that there is only or process reading the queue |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jun 19, 2007 7:19 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
There are conditions and setups in which message #2 will be returned to an MQGet before message 1 has been retried all n times, and then backed out.
It depends, among other things, on the sequence of Gets relative to the sequence of Backouts. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
rparti |
Posted: Tue Jun 19, 2007 7:20 am Post subject: |
|
|
 Voyager
Joined: 05 Oct 2005 Posts: 86 Location: U.S.A.
|
So its more a matter of chance and timing |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jun 19, 2007 7:22 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
rparti wrote: |
So its more a matter of chance and timing |
No. It's a matter of how you have designed and implemented the application reading the messages from the queue.
MQ is always deterministic. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
rparti |
Posted: Tue Jun 19, 2007 7:32 am Post subject: |
|
|
 Voyager
Joined: 05 Oct 2005 Posts: 86 Location: U.S.A.
|
Thanks....I think its easier to continue processing Q1 in a loop, put the bad message in another queue, where it will come back to Q1 after a delay for retry.
Otherwise Q1 processing code can get very complex |
|
Back to top |
|
 |
|