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 » how did i generate a new MQ msgid in esql

Post new topic  Reply to topic
 how did i generate a new MQ msgid in esql « View previous topic :: View next topic » 
Author Message
chrisgclark
PostPosted: Thu Feb 18, 2010 3:03 am    Post subject: how did i generate a new MQ msgid in esql Reply with quote

Apprentice

Joined: 26 Mar 2009
Posts: 35

Hi,

Any ideas how to generate a new MQ msgIDs in ESQL. I have a coding problem where i need a unique number in addition to the msgID that is in the inbound message.

I tried RAND() function, but as my flow is multi-threaded I found occasionally the value was the same. If I can generate msgIDs I would hope these were always unique.

Thanks.

Chris
Back to top
View user's profile Send private message
Gaya3
PostPosted: Thu Feb 18, 2010 3:18 am    Post subject: Reply with quote

Jedi

Joined: 12 Sep 2006
Posts: 2493
Location: Boston, US

how about using timestamp.
_________________
Regards
Gayathri
-----------------------------------------------
Do Something Before you Die
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Feb 18, 2010 3:22 am    Post subject: Re: how did i generate a new MQ msgid in esql Reply with quote

Grand High Poobah

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

chrisgclark wrote:
Hi,

Any ideas how to generate a new MQ msgIDs in ESQL. I have a coding problem where i need a unique number in addition to the msgID that is in the inbound message.

I tried RAND() function, but as my flow is multi-threaded I found occasionally the value was the same. If I can generate msgIDs I would hope these were always unique.

Thanks.

Chris

What you want is not to generate a message id but to generate a broker UUID.
See http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/topic/com.ibm.etools.mft.doc/ak05910_.htm
and http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/topic/com.ibm.etools.mft.doc/ak05900_.htm

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
chrisgclark
PostPosted: Thu Feb 18, 2010 3:33 am    Post subject: Reply with quote

Apprentice

Joined: 26 Mar 2009
Posts: 35

Hi Gaya3, I tried using timestamp but as my flow is multithreaded I found occassions where the same timestamp was used, even down to milli seconds (i could see same timestamp being used in user trace output).

fjb_saper, I'll try using UUIDASCHAR.

Many thanks for the suggestions.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Feb 18, 2010 3:37 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

This has been discussed quite comprehensively here before.

As I recall, only part of the UUID will be the Unique bit. Take that part and convert it to a BLOB then it can be used as the MQMD.MsgId//CorrelId etc as required byt the flow.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Feb 18, 2010 3:38 am    Post subject: Reply with quote

Grand High Poobah

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

chrisgclark wrote:
Hi Gaya3, I tried using timestamp but as my flow is multithreaded I found occassions where the same timestamp was used, even down to milli seconds (i could see same timestamp being used in user trace output).

fjb_saper, I'll try using UUIDASCHAR.

Many thanks for the suggestions.

As you were talking about something on top of msgID I would have thought you'd be more interested in UUIDASBLOB...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
chrisgclark
PostPosted: Thu Feb 18, 2010 3:47 am    Post subject: Reply with quote

Apprentice

Joined: 26 Mar 2009
Posts: 35

my broker code requires a unique string (in addition to msg id) so either char or blob would do here
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 » WebSphere Message Broker (ACE) Support » how did i generate a new MQ msgid in esql
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.