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 » How unique is an auto-generated correlationId?

Post new topic  Reply to topic
 How unique is an auto-generated correlationId? « View previous topic :: View next topic » 
Author Message
jase_t_thomas
PostPosted: Wed Mar 17, 2010 1:41 am    Post subject: How unique is an auto-generated correlationId? Reply with quote

Newbie

Joined: 08 Feb 2010
Posts: 6

How unique is the correlationId when a legacy application uses MQC.MQPMO_NEW_CORREL_ID to generate a correlId for a message?

Is it unique for a queue manager? I would have thought it was.

What if there are multiple queue managers residing on different machines? Or multiple queue managers connected in a cluster ?

Are there any occasions when collisions are possible and how likely?

Any thoughts?
Back to top
View user's profile Send private message
harish_td
PostPosted: Wed Mar 17, 2010 2:02 am    Post subject: Reply with quote

Master

Joined: 13 Feb 2006
Posts: 236

From the Application Programming Reference - Read..re-read and re-read it.

Whats true for the MsgId is also true for the CorrelID if you get the QM to auto-generate it.


Quote:

A MsgId generated by the queue manager consists of a 4-byte product identifier (AMQb or CSQb in either ASCII or EBCDIC, where b represents a blank), followed by a product-specific implementation of a unique string. In WebSphere MQ this contains the first 12 characters of the queue-manager name, and a value derived from the system clock.
All queue managers that can intercommunicate must therefore have names that differ in the first 12 characters, in order to ensure that message identifiers are unique. The ability to generate a unique string also depends on the system clock not being changed backward. To eliminate the possibility of a message identifier generated by the queue manager duplicating one generated by the application, the application must avoid generating identifiers with initial characters in the range A through I in ASCII or EBCDIC (X’41’ through X’49’ and
X’C1’ through X’C9’). However, the application is not prevented from generating identifiers with initial characters in these ranges.


Last edited by harish_td on Wed Mar 17, 2010 2:14 am; edited 2 times in total
Back to top
View user's profile Send private message Yahoo Messenger
zonko
PostPosted: Wed Mar 17, 2010 2:02 am    Post subject: Reply with quote

Voyager

Joined: 04 Nov 2009
Posts: 78

It is unique by qmgr.
If a qmgr of the same name exists elsewhere, then it is possible for msgs created on that qmgr to have the same correl ID.

Multiple qmgrs of the same name cannot be directly connected, either via point-to-point channels or in a cluster.

For a collision to occur, the msg would have to be created on each qmgr of the same name at the same timestamp, with a granularity of 1 second.
Back to top
View user's profile Send private message
jase_t_thomas
PostPosted: Wed Mar 17, 2010 3:44 am    Post subject: Reply with quote

Newbie

Joined: 08 Feb 2010
Posts: 6

Many thanks for your responses.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Mar 17, 2010 5:01 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

zonko wrote:
Multiple qmgrs of the same name cannot be directly connected, either via point-to-point channels or in a cluster.


I think you mean "SHOULD NOT BE".

There aren't any checks, even in v7.0.1.1, that I'm aware of that will *prevent* this.

But doing so is the source of nightmares for MQ admins everywhere. "The developer wanted to emulate production, so he just created the same qmgr name and added it to the cluster"
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Mar 17, 2010 1:18 pm    Post subject: Reply with quote

Grand High Poobah

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

mqjeff wrote:
zonko wrote:
Multiple qmgrs of the same name cannot be directly connected, either via point-to-point channels or in a cluster.


I think you mean "SHOULD NOT BE".

There aren't any checks, even in v7.0.1.1, that I'm aware of that will *prevent* this.

But doing so is the source of nightmares for MQ admins everywhere. "The developer wanted to emulate production, so he just created the same qmgr name and added it to the cluster"


Welcome to a whole new nightmare. It may easily ruin your day to disregard this principle. Secure your clusters with SSL. You'll know if you request 2 certs for qmgrs with the same DN...CN=myqmgrname....

Have fun
_________________
MQ & Broker admin
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 » IBM MQ Java / JMS » How unique is an auto-generated correlationId?
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.