| Author | 
		  Message
		 | 
		
		  | chrisgclark | 
		  
		    
			  
				 Posted: Thu Feb 18, 2010 3:03 am    Post subject: how did i generate a new MQ msgid in esql | 
				     | 
			   
			 
		   | 
		
		
		   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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Gaya3 | 
		  
		    
			  
				 Posted: Thu Feb 18, 2010 3:18 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi
 
 Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US 
  | 
		  
		    
			  
				how about using timestamp. _________________ Regards
 
Gayathri
 
-----------------------------------------------
 
Do Something Before you Die | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | fjb_saper | 
		  
		    
			  
				 Posted: Thu Feb 18, 2010 3:22 am    Post subject: Re: how did i generate a new MQ msgid in esql | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 18 Nov 2003 Posts: 20768 Location: LI,NY 
  | 
		  
		    
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | chrisgclark | 
		  
		    
			  
				 Posted: Thu Feb 18, 2010 3:33 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | smdavies99 | 
		  
		    
			  
				 Posted: Thu Feb 18, 2010 3:37 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | fjb_saper | 
		  
		    
			  
				 Posted: Thu Feb 18, 2010 3:38 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 18 Nov 2003 Posts: 20768 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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | chrisgclark | 
		  
		    
			  
				 Posted: Thu Feb 18, 2010 3:47 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |