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 » Trigger message consumption

Post new topic  Reply to topic
 Trigger message consumption « View previous topic :: View next topic » 
Author Message
Vin
PostPosted: Fri Jul 12, 2002 2:20 pm    Post subject: Trigger message consumption Reply with quote

Master

Joined: 25 Mar 2002
Posts: 212
Location: India

We have an interesting situation here. I'm using triggering for one of our applications and was wondering about a few things. When my application gets the message after being triggered and for some reason fails to process the message retrieved from the queue, that message is essentially lost right? Is there a way that I can put the message back on the Queue if the trigerred process fails so that when my app is backit can process the message again? How can I do this using MQJMS? The platform we are using is Solaris, messages are sent from the mainframe. Any ideas? Thanks.
Back to top
View user's profile Send private message
bduncan
PostPosted: Fri Jul 12, 2002 3:07 pm    Post subject: Reply with quote

Padawan

Joined: 11 Apr 2001
Posts: 1554
Location: Silicon Valley

If you do your MQGET under syncpoint, then if you application dies before committing the removal of the message from the queue, it should be rolled back automatically and be ready for processing when another application is triggered.
_________________
Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator
Back to top
View user's profile Send private message Visit poster's website AIM Address
PeterPotkay
PostPosted: Fri Jul 12, 2002 4:48 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

Be careful of poisened loops! You are tiggered on first and a message lands, starting your app. You get the message under syncpoint and then roll it back to the queue for whatever reason. As you go to close the queue, the QM realizes that you are closing a triggered on first queue with more than zero messages on it. So it generates another trigger message to the init queue. As soon as your app ends, the trigger monitor sees your app end, sees a trigger message for it on the init queue, and starts it up again. Your app picks up the same message again, rolls it back again, closes the queue again and retriggers itself again, forever and ever!

Any triggered on first apps that get their messages under syncpoint should always check the MQMD-Backoutcount count right after the GET. This is because each time you go thru that above loop, the QM ups the backout count of the message by one. If you see that this # is higher than say, 1, your app knows this message has been picked up at least twice before and may be a problem. Discard it or put it off to an exception queue and get on to the next message on the queue.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
Vin
PostPosted: Fri Jul 12, 2002 5:42 pm    Post subject: Reply with quote

Master

Joined: 25 Mar 2002
Posts: 212
Location: India

Appreciate all your suggestions. Questions is, is this possible with JMS? I know that JMS is not really as friendly as MQBase Java? Thanks.
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Sat Jul 13, 2002 8:49 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

I am not a JMS programmer, but look at table 21 in the Using Java with MQ manual http://publibfp.boulder.ibm.com/epubs/html/csqzaw09/csqzaw09tfrm.htm

JMS has a field called JMSXDeliveryCount , which maps to the MQMD Backout count.

Let me know if this will work for you. I am curious.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
Vin
PostPosted: Sat Jul 13, 2002 1:38 pm    Post subject: Reply with quote

Master

Joined: 25 Mar 2002
Posts: 212
Location: India

Was wondering how to extract this value from the header? could not find any function which will let me do that on the message? any clues? Thanks
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 » Trigger message consumption
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.