0

I have a queue Q1 which has backout queue as QB and backout threshold as 3. I'm working on various possibilities of handling poison messages so I have made my application throw exception whenever I read a message from the queue and keep polling the queue. Depth of Q1 is 15, QB is 5 and DLQ is 5. For first scenario, I input 7 messages into Q1 and started the application. As expected, the each message was rolled back to the queue and moved to the backout queue when backout count is 3. During sixth message, since QB is full, the message moves to DLQ and as do the seventh one. Works charmingly.

For the second scenario where I need to know what will happen when both backout queue and DLQ is full, I input 12 messages and started the application, for first 10 messages everything works as expected, 5 in backout and 5 in DLQ. For the next, it throws DLQ is full which is obvious.

But what I can observe in the MQ explorer is, the 12 messages just keep on looping between Q1, QB and DLQ infinitely and when I myself stopped the application, all the messages end up in the Q1 as like before I started the application.

Completely confused, googled a lot but found nothing similar to this.

Can anyone point out what I'm doing wrong or what piece is missing in this puzzle.

Thanks in advance.

JoshMc
  • 10,239
  • 2
  • 19
  • 38
Ravi Shankar
  • 11
  • 1
  • 2
  • Based on the use of a backout queue I am assuming you are using the IBM MQ classes for JMS API. Can you confirm if you are using a async message listener? Is the session transacted? Is it a commit issue? How are you able to determine that messages are looping between the queues. In the situation you describe the last two messages when they can not go to either QB or DLQ the would be put back to Q1 and the reading would pick them backup and still have a poison message issue. Can you show some more details of your code and how your app is setup? – JoshMc May 21 '18 at 17:02
  • I'm using spring JMS template. It's synchronous. I just modified my application so that I just manually throw an exception when the input source reads the message from queue. This is silly but am just mimicking a poison message scenario. I'm testing how the backout queue perform in various scenarios. – Ravi Shankar May 22 '18 at 12:07
  • One scenario, where I modified my code to throw manual exception only when the payload has "poison" text in it. So I input 4 message with text "poison" in it. 5th a normal one. Then followed by 10 messages with text "poison". What happens this time is only the last 10 messages looped between the queues. So I wonder is there anything to do with COMMIT ??? Because all "poison"s were roll back but only the fifth one gets commited. Im not good understanding how the transaction works in MQ and it's sessions. – Ravi Shankar May 22 '18 at 12:17
  • I do think it has to do with COMMIT. You mention Spring so I'm adding that tag, there are some users (@GaryRussell and @ArtemBilan) that provide great answers to spring questions. – JoshMc May 22 '18 at 16:48
  • Thanks a lot for your time on this @JoshMc – Ravi Shankar May 22 '18 at 18:47
  • Moving messages to the BOQ is the responsibility of the application reading the input queue, so this is not done by the queue manager. You will need to provide more information about the application reading the messages to get an answer. – Attila Repasi May 24 '18 at 11:30
  • @AttilaRepasi the app is using spring which uses the IBM MQ classes for JMS so the BOQ functionality is built in and as far as I know does not require any client side setting to enable it's use nor can you change it's behavior client side. – JoshMc May 25 '18 at 06:25
  • Yes @JoshMc we just need to set the name of the backout queue and threshold in the app's input queue's storage properties. MQ will take care of the rest. Nothing to be done on client side. – Ravi Shankar May 25 '18 at 13:51
  • @GaryRussell Do you have any insight in to why if both BOQ and DLQ are full that the messages are all being backed out to the original input queue? – JoshMc May 25 '18 at 16:09

0 Answers0