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 » General IBM MQ Support » how to retrieve remaining msgs of a group in case appln dies

Post new topic  Reply to topic
 how to retrieve remaining msgs of a group in case appln dies « View previous topic :: View next topic » 
Author Message
brgmo
PostPosted: Sat Nov 29, 2003 10:23 am    Post subject: how to retrieve remaining msgs of a group in case appln dies Reply with quote

Master

Joined: 03 Jun 2002
Posts: 227

Hi All

I am writing an application in which messages are sent and retrieved in a group. Now, in case i have send 10 messages in a group. Now when i retrieve the message i use ALL_MESSAGES_AVAILABLE option and every time a message is retrieved i call commit. Now suppose after recieveing 6 messages my application dies and when i restart the application and try to retrive the remaining mesages of that particular group, the call executes with the no messages available exception(2033). The messages remain on the queue and can not be retrived. Thesemessages that i am retrieving
are used to construct a file. Now my question is ow to retrieve the remaining messages of the group once the application is restarted. Please help me as this is very urgent and i was struggling to solve this problem for past few days and i am unable to solve it.

Thanks in advance
brgmo.
Back to top
View user's profile Send private message
EddieA
PostPosted: Sat Nov 29, 2003 11:09 am    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Don't call commit until you have read and processed ALL the mesages in the group.

Or modify the example, Putting and getting a group that spans units of work, in the Message Segmentation section of Chapter 10, Getting Messages from a Queue in the Application Programming Guide. It uses a 'Status' Queue to hold information about where in the Group you are currently processing.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
brgmo
PostPosted: Sat Nov 29, 2003 12:29 pm    Post subject: Reply with quote

Master

Joined: 03 Jun 2002
Posts: 227

Thanks a lot eddie for replying.But my question here is to how to rerieve the messages of a group which could not be retrived due to application failure.now when the application is up and when i try to retrieve the message,the call ends with no message available reason code even though the messages are available on the queue.my business requirement is such that i have to commit every time a message arrives and populate a file.so can you give me some idea as how to retrieve the remaining messages of a group once the application dies after retrieving some messages.i will be waiting for your resonse.

thanks
brgmo
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Sat Nov 29, 2003 12:56 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You'll have to modify your code. You can't get messages from a partial group when using ALL_MESSAGES_AVAILABLE.

You'll have to do something when your app starts up to determine if there are messages that aren't part of a complete group, and then get the messages without using ALL_MESSAGES_AVAILABLE.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
EddieA
PostPosted: Sat Nov 29, 2003 9:48 pm    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Based on the reference I posted above:

Code:
GET under Syncpoint from STATUS Queue
If NO MESSAGE, set option ALL_MESSAGES, no GroupId
else, set MATCH OPTIONS to GroupId and SEQ from message.
Label A.
GET message under Synpoint.
Process Message.
If message was Last-in-Group, then Commit and EXIT.
Build STATUS message using GroupId and SEQ + 1.
PUT STATUS message under Syncpoint.
Commit.
Set options to get Next Logical message.
Loop back to Label A.


This doesn't consider that there might be more than one Logical Group on the Queue at the same time. I'll leave that to you.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
brgmo
PostPosted: Sun Nov 30, 2003 2:18 pm    Post subject: Reply with quote

Master

Joined: 03 Jun 2002
Posts: 227

THANKS A LOT EDDIE.i tried to implement pseudocode sent by you but some how i am not able to understand what is meant by status queue and how to store the status of a particular message on status queue and how to retrieve a missing message's details in a group in case the reply message doesn't come for a particular request message.if you can send me some more elaborative code written in java, it will be really helpful for me or else if you can explain the status queue in greater details as how to use it in case of missing mesages in the group, it will help me in implementing and coding the solution easily.

Thanks,thanks a lot Eddie for all your guidance.
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 » General IBM MQ Support » how to retrieve remaining msgs of a group in case appln dies
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.