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 » Generating unique id

Post new topic  Reply to topic
 Generating unique id « View previous topic :: View next topic » 
Author Message
bnewman18
PostPosted: Fri Mar 29, 2002 11:24 am    Post subject: Reply with quote

Newbie

Joined: 06 Mar 2002
Posts: 5

I would like to use MQSI to generate unique message ids as messages are received. This id will be used to track messages as they flow through mqsi and ensure message delivery. I would also like to generate id's as I save messages persistently in the database. Does anyone have any thoughts as to how to accomplish this using a database table for generating the id?

My thinking was to have a node which generates the Id by selecting from a table called maxid, incrementing the current value, and saving the new value. The problem is I'm not sure how MQSI will deal with the multiple threading that happens.

Anyone have additional thoughts on how to accomplish this or is the threading not a problem?

Thanks.
Back to top
View user's profile Send private message
kolban
PostPosted: Fri Mar 29, 2002 12:17 pm    Post subject: Reply with quote

Grand Master

Joined: 22 May 2001
Posts: 1072
Location: Fort Worth, TX, USA

Have you considered using the UUIDASBLOB or UUIDASCHAR functions in WMQI 2.1? They generate universally unique identifiers within ESQL.
Back to top
View user's profile Send private message
kirani
PostPosted: Fri Mar 29, 2002 4:50 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

MQMD.MsgId is also a unique key if all the messages are generated by a single queue manager. You can also use this as a key field in your message flows.
Back to top
View user's profile Send private message Visit poster's website
Tibor
PostPosted: Sat Mar 30, 2002 1:51 am    Post subject: Reply with quote

Grand Master

Joined: 20 May 2001
Posts: 1033
Location: Hungary

when you connect to DB2, try this (or a similar)

Code:

set OutputDestinationList.uuid_tmp[] = passthru('
   select left(hex(generate_unique()),20) || hex(rand()) as UUID
      from syscat.tables
      fetch first 1 row only
      optimize for 1 row');

set OutputDestinationList.uuid = OutputDestinationList.uuid_tmp.UUID;

set OutputDestinationList.uuid_tmp = NULL;


Kirani,

MsgId is unique, theoretically, but I saw same MsgIds in a queue...
Back to top
View user's profile Send private message
jfluitsm
PostPosted: Sun Mar 31, 2002 2:24 am    Post subject: Reply with quote

Disciple

Joined: 24 Feb 2002
Posts: 160
Location: The Netherlands

Tibor,

MQSI copies the msgid from the input by default. So if you use 2 or more MQOutput nodes, these messages will have the same msgid.
Also, when the message is written from a program, and the MQMD is not set properly, all the messages will have the same msgid as the first.

_________________
Jan Fluitsma

IBM Certified Solution Designer WebSphere MQ V6
IBM Certified Solution Developer WebSphere Message Broker V6
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 » Generating unique id
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.