|  | 
 
  
    | RSS Feed - WebSphere MQ Support | RSS Feed - Message Broker Support |  
 
  
	|    |  |  
  
	| Get the Correlation Id ????? | « View previous topic :: View next topic » |  
  	| 
		
		
		  | Author | Message |  
		  | elvis_gn | 
			  
				|  Posted: Wed Dec 08, 2004 2:14 am    Post subject: Get the Correlation Id ????? |   |  |  
		  |  Padawan
 
 
 Joined: 08 Oct 2004Posts: 1905
 Location: Dubai
 
 | 
			  
				| Hi, I am running a JAVA program which needs to take the correlation Id from the message header and put it back into another queue.
 
 I have declared a MQMessage object 'message and that is able to put the message,if i assign a sting to it......
 
 But the problem is i'm not able to get the correlation Id from the message itself ????
 
 Could some one tell me the API
 |  |  
		  | Back to top |  |  
		  |  |  
		  | slaupster | 
			  
				|  Posted: Wed Dec 08, 2004 5:47 am    Post subject: |   |  |  
		  | Apprentice
 
 
 Joined: 17 Nov 2004Posts: 41
 
 
 |  |  
		  | Back to top |  |  
		  |  |  
		  | fjb_saper | 
			  
				|  Posted: Wed Dec 08, 2004 2:04 pm    Post subject: |   |  |  
		  |  Grand High Poobah
 
 
 Joined: 18 Nov 2003Posts: 20767
 Location: LI,NY
 
 | 
			  
				| You are sure that you are not supposed to take the MESSAGEID of the incoming message and put it into the CorrelationID field of the outgoing message ? 
 Enjoy
  |  |  
		  | Back to top |  |  
		  |  |  
		  | bower5932 | 
			  
				|  Posted: Wed Dec 08, 2004 2:11 pm    Post subject: |   |  |  
		  |  Jedi Knight
 
 
 Joined: 27 Aug 2001Posts: 3023
 Location: Dallas, TX, USA
 
 | 
			  
				| You should be able to just set your new id based on what your old id is.  For example, something like: 
   
	| Code: |  
	| MQMessage msg = new MQMessage(); /* get a new message */
 MQPutMessageOptions pmo = new MQPutMessageOptions(); /* get a new PMO */
 pmo.options = MQC.MQPMO_NEW_MSG_ID | MQC.MQPMO_NEW_CORREL_ID; /* we want new msg, correl id's */
 
 qServer.put(msg, pmo); /* put the message */
 
 MQMessage msgReply = new MQMessage(); /* get a new message */
 msgReply.messageId = msg.messageId; /* copy the put message id to the new message's message id */
 
 |  
 And, I suspect that fjb_saper is right about what you want to do.  The normal pattern is to reply to a message and move the incoming message's message id to the outgoing message's correlation id.
 |  |  
		  | Back to top |  |  
		  |  |  
		  |  |  |  
  
	|    |  | Page 1 of 1 |  
 
 
  
  	| 
		
		  | 
 
 | 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
 
 |  |  |  |