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 API Support » MQ MsgId

Post new topic  Reply to topic
 MQ MsgId « View previous topic :: View next topic » 
Author Message
MVO
PostPosted: Mon Feb 09, 2004 6:59 am    Post subject: MQ MsgId Reply with quote

Centurion

Joined: 09 Sep 2001
Posts: 131

Hi,

Can you tell me what uniquely identifies a message in a queue of a queue manager ? because I can put 2 messages with the same MsgId to a queue without any problem - at least on a non-mainframe platform such as Windows, Unix.

If we allow duplicate MsgIds, does it mean recovery will not be possible ?

Thanks
Back to top
View user's profile Send private message
vennela
PostPosted: Mon Feb 09, 2004 7:16 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

This is from the Application Reference manual
Quote:

Generally, no two messages should have the same message identifier, although this is not disallowed by the queue manager.


But if you want you can allow the Queue Manager to generate a unique message id for you.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kman
PostPosted: Tue Feb 17, 2004 12:59 am    Post subject: Reply with quote

Partisan

Joined: 21 Jan 2003
Posts: 309
Location: Kuala Lumpur, Malaysia

If you set your own message ID, the queue manager would still send the message. It is not a restriction. But if you let the queue manager create and set the msg ID, this will always be unique.

Reason for uniqueness is because
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 upon the system clock not being changed backward.
Back to top
View user's profile Send private message Yahoo Messenger
MVO
PostPosted: Tue Feb 17, 2004 6:10 am    Post subject: Reply with quote

Centurion

Joined: 09 Sep 2001
Posts: 131

Thanks for all your replies. They still don't answer my question. If 2 messages in the same queue on the same queue manager have the same MsgId, does it mean they cannot be recovered in case of MQ failure that requires recovery from MQ logs ?
Back to top
View user's profile Send private message
bob_buxton
PostPosted: Tue Feb 17, 2004 6:10 am    Post subject: Reply with quote

Master

Joined: 23 Aug 2001
Posts: 266
Location: England

The queue manager does not rely on the message id (or correlid) being unique for recovery purposes. It has its own mechanisms for identifying messages to be restored from the logs on restart.

Some applications may require unique message ids in order to work correctly, for example, if they also use message id as a database key.
_________________
Bob Buxton
Ex-Websphere MQ Development
Back to top
View user's profile Send private message
bduncan
PostPosted: Tue Feb 17, 2004 12:36 pm    Post subject: Reply with quote

Padawan

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

Bob is right.
There is nothing inherently wrong with having multiple messages on the same queue with the same MsgId - but why would you want to ever do that?
_________________
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
manojt
PostPosted: Tue Feb 24, 2004 5:05 am    Post subject: Reply with quote

Newbie

Joined: 26 Sep 2003
Posts: 9

Yes two msg can have same msg ID. Question how Q Manager recovers is i think it uses timestamp to identify the unique msg because u know no 2 msg can have same time stamp. correct me if i m wrong.

Manoj
Back to top
View user's profile Send private message
kman
PostPosted: Tue Feb 24, 2004 5:13 am    Post subject: Reply with quote

Partisan

Joined: 21 Jan 2003
Posts: 309
Location: Kuala Lumpur, Malaysia

Manoj,
you are not entirely right in that sense. A time stamp can still be duplicate. That's why for unique msgid, MQ have added a few more fields to it. See my previous posting on this.
Back to top
View user's profile Send private message Yahoo Messenger
Missam
PostPosted: Tue Feb 24, 2004 3:35 pm    Post subject: Reply with quote

Chevalier

Joined: 16 Oct 2003
Posts: 424

queue manager uses checkpoint while recovering from a failure not msgids and timestamps.if you have more questions about recovery ,you can go through System Adminstration .Restart and recovey.this explains much in detail
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 API Support » MQ MsgId
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.