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 Discussion » Message Sequence

Post new topic  Reply to topic
 Message Sequence « View previous topic :: View next topic » 
Author Message
mqfond
PostPosted: Mon Mar 28, 2005 12:30 pm    Post subject: Message Sequence Reply with quote

Novice

Joined: 28 Mar 2005
Posts: 20

We are sending messages to the remote machine and that machine needs the mesages in certain order, orelse it gives error. They are planning to write a java program on the remote box to do that, maybe check to see that all required messages come through before it commits. What do yo u think would be the best approach to write that in java???
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Mar 28, 2005 2:05 pm    Post subject: Reply with quote

Grand High Poobah

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

Why not put the whole transaction into a single message ?

Back to top
View user's profile Send private message Send e-mail
hopsala
PostPosted: Mon Mar 28, 2005 2:34 pm    Post subject: Reply with quote

Guardian

Joined: 24 Sep 2004
Posts: 960

MQSeries has build in structures and options in MQI (or the Java MQ API) to help you do this more easily.
in the MQMD Structures there are fields called MessageGroup and LogicalMessageNumber (may be different names for different API's). What you do is give each transaction a group number, say 1, and then enumerate each message belonging to that transaction, so that you have the first is message 1 in group 1, the second msg 2 in grp 1 etc. In the last you mark a flag saying this is the last message in the group. Then you move on to the next transaction, create a group 2 and so on and so forth...

Now, this Does Not make sure that the message arrive to the queue in the right order, but if in the receiving application you choose MQGMO= MQGMO_LOGICAL_ORDER you will get the in order, so if for example you have only msg with grp=1 num=2 in the queue, the application will wait until msg grp=1 num=1 comes through and gets it.

(You will probably also want to put all messages in group as one transaction, meaning you do not MQCMIT them until they are all MQPUT to the queue by the sending application...)

See details of this in MQ Application Guide chapter 10 section 2 "The order in which messages are retrieved from a queue".

Luck!
Back to top
View user's profile Send private message
mqfond
PostPosted: Mon Mar 28, 2005 4:44 pm    Post subject: Reply with quote

Novice

Joined: 28 Mar 2005
Posts: 20

Thanks guys. I will definitely try your suggestions.
Back to top
View user's profile Send private message
mqfond
PostPosted: Tue Mar 29, 2005 8:16 am    Post subject: Reply with quote

Novice

Joined: 28 Mar 2005
Posts: 20

One more doubt i got about grouping and sequencing the messages by hopsala, we are using two queue managers for the load balancing. I guess we can't get that sequencing as the messages might be generated from different queue managers??? am i right??
Back to top
View user's profile Send private message
bower5932
PostPosted: Tue Mar 29, 2005 9:05 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

You might need to look into the BIND_ON_OPEN option on your MQOPEN to make sure that you get bound to a specific queue (queue manager) for all of the messages that you put.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Keka
PostPosted: Tue Mar 29, 2005 11:51 am    Post subject: Reply with quote

Voyager

Joined: 28 Dec 2002
Posts: 96

You said you are using two queue managers for load balancing, so the assumption here is you are using Clustering. If you are bind on open from the application side will make all the messages go in to the same queue manager and same queue instance. you also have to use logical grouping under symcpointing from the application side.
Onthe server side again as suggested you have to use logical reading with a get under sync point.
_________________
Keka
Back to top
View user's profile Send private message
mqfond
PostPosted: Tue Mar 29, 2005 11:56 am    Post subject: Reply with quote

Novice

Joined: 28 Mar 2005
Posts: 20

Hey thanks for the info. Yes we are using cluster. I will definitely take your consideration.
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 Discussion » Message Sequence
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.