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 » WebSphere Message Broker (ACE) Support » Ordering messages across multiple instances

Post new topic  Reply to topic
 Ordering messages across multiple instances « View previous topic :: View next topic » 
Author Message
crossland
PostPosted: Mon May 14, 2012 4:58 am    Post subject: Ordering messages across multiple instances Reply with quote

Master

Joined: 26 Jun 2001
Posts: 248

The article http://www.ibm.com/developerworks/websphere/library/techarticles/0311_dunn/dunn.html covers message sequencing as follows:

Quote:

Message sequencing is controlled by the Order Mode property on the Advanced Properties tab of the MQInput node. There are three possible values:

Default
Messages are retrieved in the order defined by the queue attributes, but this order is not guaranteed as the messages are processed by the message flow.

User Id
Messages that have the same UserIdentifier in the MQMD are retrieved and processed in the order defined by the queue attributes, and this order is guaranteed to be retained when the messages are processed. Therefore, a message associated with a particular UserIdentifier that is being processed by one thread will be completely processed before the same thread, or another thread, can start to process another message with the same UserIdentifier. No other ordering is guaranteed to be preserved.

Queue order
Messages are retrieved and processed by this node in the order defined by the queue attributes, and this order is guaranteed to be retained when the messages are processed. This behaviour is identical to the behaviour exhibited if the Additional Instances property of the message flow is set to 0.


This seems to suggest that the only option for message sequencing across multiple instances is to order by userid (as the two other alternatives are either "order not guaranteed" or "identical to the behaviour exhibited if Additional Instances = 0"). However, many sites do not allow the userid to be set for security reasons.

Has anybody managed to achieve message sequencing across multiple instances, by a means other than setting order mode = userid? After a long trawl through this site and various others, I have been unable to find another alternative.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Mon May 14, 2012 5:10 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

If message ordering is your goal, this implies that you intend to process messages sequentially. What's the point of having multiple instances when you need to process messages sequentially?

If you want multiple sequential streams, set a CorrelId and assign that CorrelId to a specific instance.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
crossland
PostPosted: Mon May 14, 2012 6:19 am    Post subject: Reply with quote

Master

Joined: 26 Jun 2001
Posts: 248

The manual states the following for order by userid"

Quote:
Messages that have the same UserIdentifier in the MQMD are retrieved and processed in the order that is defined by the queue attributes; this order is guaranteed to be preserved when the messages are processed.


Are you saying that assigning the CorrelId to a specific instance would also result in the order being guaranteed to be preserved when the messages are processed?
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Mon May 14, 2012 6:26 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

crossland wrote:
The manual states the following for order by userid"

Quote:
Messages that have the same UserIdentifier in the MQMD are retrieved and processed in the order that is defined by the queue attributes; this order is guaranteed to be preserved when the messages are processed.


Are you saying that assigning the CorrelId to a specific instance would also result in the order being guaranteed to be preserved when the messages are processed?


No.

Flow 1 MQInput node with CorrelId set to 1. Flow 2 MQInput node with CorrelId set to 2. Flow 3 MQInput node with CorrelId set to 3.

Each CorrelId represents a unique stream where the messages are utilizing sequence Id within that stream:

http://www.ibm.com/developerworks/websphere/library/techarticles/0602_currie/0602_currie.html

The point is, you are illogical in your premise. You say you want multiple instances of your flow, but that the messages must be processed sequentially. This is illogical (unless you follow the grouping as I have described).

What's the point of having multiple instances when you must process the messages sequentially anyway?
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Mon May 14, 2012 11:32 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

lancelotinc said:
Quote:
What's the point of having multiple instances when you must process the messages sequentially anyway?
Perhaps because lower latency can be achieved by splitting the workload for a single batch of messages across multiple instances, and then re-sequencing the results.

I'm just theorising, by the way. I'll leave the rest to others who have implemented actual solutions to this problem.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Mon May 14, 2012 11:58 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

kimbert wrote:
lancelotinc said:
Quote:
What's the point of having multiple instances when you must process the messages sequentially anyway?
Perhaps because lower latency can be achieved by splitting the workload for a single batch of messages across multiple instances, and then re-sequencing the results.

I'm just theorising, by the way. I'll leave the rest to others who have implemented actual solutions to this problem.


Yes, Sir Kimbert, a good use of this design. Would this be more akin to Fan-Out-Fan-In? And since the recomposition is done in the Fan-In flow, sequentializing the Fan-Out is no longer important (meaning that the OP's original premise is not valid since the logic of recomposition is done outside of the original transaction).
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Ordering messages across multiple instances
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.