ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » Backout queues in MQ JMS using Spring.

Post new topic  Reply to topic
 Backout queues in MQ JMS using Spring. « View previous topic :: View next topic » 
Author Message
krama5717
PostPosted: Thu Sep 17, 2015 1:43 pm    Post subject: Backout queues in MQ JMS using Spring. Reply with quote

Newbie

Joined: 17 Sep 2015
Posts: 4

I am struggling with code that uses CLIENT_ACKNOWLEDGE mode in a Spring/JMS enabled piece of code. What we want to do is to throw a poisoned message to the back out queue. I cannot find any examples anywhere to achieve this in CLIENT_ACKNOWLEDGE mode. I do know that this is relatively easy to do in TRANSACTION mode. Please help.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Sep 17, 2015 5:35 pm    Post subject: Re: Backout queues in MQ JMS using Spring. Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

krama5717 wrote:
I am struggling with code that uses CLIENT_ACKNOWLEDGE mode in a Spring/JMS enabled piece of code. What we want to do is to throw a poisoned message to the back out queue. I cannot find any examples anywhere to achieve this in CLIENT_ACKNOWLEDGE mode. I do know that this is relatively easy to do in TRANSACTION mode. Please help.

AFAIK you can only have this happen in client_acknowledge mode, if MQ itself determines that the message is bad an cannot be delivered / read.
Anything else gets aknowledged when the client in fact does acknowledge...

Keep it transactional!
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
krama5717
PostPosted: Fri Sep 18, 2015 4:41 am    Post subject: Reply with quote

Newbie

Joined: 17 Sep 2015
Posts: 4

Thank you for the wisdom, Oh Grand Poobah.. before we go down the path of modifying the code to be TRANSACTIONAL, I need guidance on just one thing more. I am thinking of short term and long term solutions here.

In this environment, under Spring , JMS, MQ ....

1. What happens to a message when the onMessage method throws an exception ? (in CLIENT_ACKNOWLEDGE )... so the message is in flight, and something happens, and we throw an exception.... what is the disposition of the message ? Will it get dropped or re-queued ? Will it get acknowledged along with a subsequent acknowledge and therefore de-queued ?

2. How do you recommend that we take care of this situation, since the backout queue mechanisms are not available to us ? If we want to drop it into a queue, do we create another queue and do a queueSender() so to speak ?

There is so much google out there, and it is an ocean to wade through. Some expert guidance is really appreciated.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Sep 18, 2015 5:46 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

If an application throws an exception while processing a transactional message, the trasaction is rolled back.

During an MQ Transaction, the message is not actually removed from the queue. It's merely marked in a transaction and so isn't visible to other readers.

Thus, when the transaction is rolled back, the message reappears on the queue.

I believe in this case the backout count is incremented.

Normal MQ applications have to handle backout themselves. I don't know what Spring does.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
krama5717
PostPosted: Fri Sep 18, 2015 9:57 am    Post subject: Reply with quote

Newbie

Joined: 17 Sep 2015
Posts: 4

Yes, in transaction mode, it's perfectly clear.... either rollback or exception will request the message. It is my understanding that client acknowledge melody is non-transactional. So where do I go look for an answer ?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Sep 18, 2015 10:05 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

IF the onMessage is part of a transaction, then when it throws an exception, the queue transaction will get rolled back.

This is not the same as backed out.

I forget if JMS handles backout for you. Regarless of what you're using to call JMS, the behavior for MQ JMS will be the same.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Backout queues in MQ JMS using Spring.
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.