|   | 
	 
  
    | 
RSS Feed - WebSphere MQ Support
 | 
RSS Feed - Message Broker Support
 |   
 
  
	     | 
	 | 
   
 
  
	|  MessageId and CorrelationId failing......... | 
	« View previous topic :: View next topic »  | 
   
  
  	
	  
		
		
		  | Author | 
		  Message
		 |  
		
		  | rajmq | 
		  
		    
			  
				 Posted: Fri Jan 10, 2003 4:52 am    Post subject: MessageId and CorrelationId failing......... | 
				     | 
			   
			 
		   | 
		 
		
		    Partisan
 
 Joined: 29 Sep 2002 Posts: 331 Location: USA 
  | 
		  
		    
			  
				Hi All,
 
 
Client application generate the request message, puts the message on the queue and message ID is stored and it is waiting for reply.
 
Server application which receives the messages, would process the request and generate reply message by copying message ID of the request message into Correlation ID of the reply message. 
 
 
I tried using the above concept i am getting message to reply queue. But my client program not able to read that reply message(due to the correlationId mismatch).The same program without checking of msgId and CorrelationId it is working fine.
 
 
can anyone give some examples programs for concept.
 
 
thanks
 
raj | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | pgorak | 
		  
		    
			  
				 Posted: Fri Jan 10, 2003 5:31 am    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		    Disciple
 
 Joined: 15 Jul 2002 Posts: 158 Location: Cracow, Poland 
  | 
		  
		    
			  
				From what you say I think the following GMO settings are needed in your client application:
 
 
MatchOptions = MQMO_MATCH_CORREL_ID
 
Options = MQGMO_WAIT
 
WaitInterval = put a reasonable time here, in milliseconds
 
 
Piotr | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | oz1ccg | 
		  
		    
			  
				 Posted: Fri Jan 10, 2003 5:32 am    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		    Yatiri
 
 Joined: 10 Feb 2002 Posts: 628 Location: Denmark 
  | 
		  
		    
			  
				Hi Raj,
 
 
have you remembered to initialize MSGID after setting the CORRID before you issue the MQGET ????    
 
 
and with Piotr's options aswell.
 
 
This is the typical error number one for Client application programmers.
 
 
Just my $0.02    _________________ Regards, Jørgen
 
Home of BlockIP2, the last free MQ Security exit  ver. 3.00
 
Cert. on WMQ, WBIMB, SWIFT. | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | rajmq | 
		  
		    
			  
				 Posted: Fri Jan 10, 2003 11:23 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		    Partisan
 
 Joined: 29 Sep 2002 Posts: 331 Location: USA 
  | 
		  
		    
			  
				Hi
 
 
 
Thansk to all
 
 
But i checked all ur pts.it is ok
 
Here i copied my code also
 
 
ServerCode(Response)
 
 
Once i got request msg, i am assiging the request msg messagId to reply msg.
 
try{
 
                    MQQueue queue = _queueManager.accessQueue    ("TESTINGMSGID1", openOptions, null, null,null);
 
                    BufferedReader d = new BufferedReader(new InputStreamReader(System.in));
 
              sendmsg = new MQMessage();
 
             MQPutMessageOptions pmo = new MQPutMessageOptions();
 
              while ((line = d.readLine()) != null) {
 
             sendmsg.clearMessage();
 
             sendmsg.messageId = MQC.MQMI_NONE;
 
             sendmsg.correlationId =message.messageId;  //Here request   msgId is assigned******
 
             sendmsg.writeString(line);
 
             queue.put(sendmsg, pmo);
 
                    }
 
Client Prg(Request)
 
 
Once i got reply back i am checking below options,But i am not able to read this message.
 
 
MQQueue queue = _queueManager.accessQueue("TESTINGMSGID1", openOptions, null, null,null);
 
MQGetMessageOptions getOptions = new MQGetMessageOptions();
 
  		getOptions.options = MQC.MQGMO_FAIL_IF_QUIESCING + MQC.MQGMO_CONVERT;
 
getOptions.matchOptions = MQC.MQMO_MATCH_CORREL_ID;
 
getOptions.options = MQC.MQGMO_WAIT;
 
while(true){
 
     MQMessage message = new MQMessage();
 
     message.correlationId =sendmsg.messageId;//i am checking here**
 
    try{
 
      queue.get(message, getOptions);
 
      byte[] b = new byte[message.getMessageLength()];
 
      message.readFully(b);
 
     System.out.println(new String(b));
 
      }
 
}
 
 
thanks
 
raj | 
			   
			 
		   | 
		 
		
		  | 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
  | 
  		 
	   
	 | 
   
 
  	 | 
	  |