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 » General IBM MQ Support » Request and Reply Message

Post new topic  Reply to topic
 Request and Reply Message « View previous topic :: View next topic » 
Author Message
rajmq
PostPosted: Sun Jan 19, 2003 5:12 am    Post subject: Request and Reply Message Reply with quote

Partisan

Joined: 29 Sep 2002
Posts: 331
Location: USA

Hi,
I am using request and reply message scenario (Client and server)

Client application generate the request message and it is putting the message to the queue.
Server application which receives the messages, would process the request and generate reply message by copying ReplytoQueue of the requestmessage.
MyReplyMessage Coding:


String replyToQueue = retrievedMessage.replyToQueueName;
"How to see the replyToQueue name ?
I given system.out.println(replyToQueue).
It is not printing anything."
int openQueueOptions = MQC.MQOO_OUTPUT | MQC.MQOO_FAIL_IF_QUIESCING;
String replyToQueueManagerName = retrievedMessage.replyToQueueManagerName;
MQQueue respQueue = qMgr.accessQueue(replyToQueue, openQueueOptions,"QM1.MANAGER",null,null);


Here i am getting error like
com.ibm.mq.MQException: Completion Code 2, Reason 2085(Unknown object name. ).

Thanks in Advance
raj
Back to top
View user's profile Send private message
nimconsult
PostPosted: Sun Jan 19, 2003 11:18 pm    Post subject: Re: Request and Reply Message Reply with quote

Master

Joined: 22 May 2002
Posts: 268
Location: NIMCONSULT - Belgium

rajmq wrote:
Hi,
String replyToQueue = retrievedMessage.replyToQueueName;
"How to see the replyToQueue name ?
I given system.out.println(replyToQueue).
It is not printing anything."


It should print something. If it does not, it probably means that the retrieved message does not have a reply-to queue defined, or that there is some programming error in the retrieval of "retrievedMessage".

Please investigate in this direction, or publish more code about the requestor and provider applications.

Nicolas
_________________
Nicolas Maréchal
Senior Architect - Partner

NIMCONSULT Software Architecture Services (Belgium)
http://www.nimconsult.be
Back to top
View user's profile Send private message Send e-mail Visit poster's website
rajmq
PostPosted: Mon Jan 20, 2003 11:35 pm    Post subject: Reply with quote

Partisan

Joined: 29 Sep 2002
Posts: 331
Location: USA

Hi

Thanks for ur Reply

Here i published my Request code
try{
BufferedReader d
= new BufferedReader(new InputStreamReader(System.in));
MQMessage sendmsg = new MQMessage();
sendmsg.format = MQC.MQFMT_STRING;
sendmsg.messageType = MQC.MQMT_REPLY;
sendmsg.replyToQueueName = "REPLYTEST";
sendmsg.replyToQueueManagerName = ' ';
MQPutMessageOptions pmo = new MQPutMessageOptions();
while ((line = d.readLine()) != null){
sendmsg.writeString(line);
queue.put(sendmsg, pmo);
}
But there is no programe error in retriveMessage Code.

regards
raj
Back to top
View user's profile Send private message
nimconsult
PostPosted: Tue Jan 21, 2003 11:03 pm    Post subject: Reply with quote

Master

Joined: 22 May 2002
Posts: 268
Location: NIMCONSULT - Belgium

Comments on your requester:

- You should use MQMT_REQUEST instead of MQMT_REPLY!
- Is this a manual transcription of your code? I think that the "put" code should be outside the "while()" loop, otherwise you will get strange results.

Is the message type the reason?

I would suggest to correct your requestor.
Post the request message, and check the reply to queue name using another tool such as the MQ Series explorer.
Run the provider and see the result.
If you still have the problem please post the entire requestor and provider codes.

Nicolas
_________________
Nicolas Maréchal
Senior Architect - Partner

NIMCONSULT Software Architecture Services (Belgium)
http://www.nimconsult.be
Back to top
View user's profile Send private message Send e-mail Visit poster's website
rajmq
PostPosted: Wed Jan 22, 2003 12:44 am    Post subject: Reply with quote

Partisan

Joined: 29 Sep 2002
Posts: 331
Location: USA

Hi nimc

Thanks for ur Reply

I changed that properties MQMT_REQUEST. After that i am able to see that Reply to queue name in MQExplorer.Now it is working.

Now what is difference MQMT_REPLY & MQMT_REQUEST?


regs
raj
Back to top
View user's profile Send private message
nimconsult
PostPosted: Sun Jan 26, 2003 11:51 pm    Post subject: Reply with quote

Master

Joined: 22 May 2002
Posts: 268
Location: NIMCONSULT - Belgium

Well I think that the names speak by themselves: MQMT_REQUEST stands for a request message, and MQMT_REPLY stands for a reply message.

But honnestly I did not know that we were not supposed to fill in the reply-to-queue in a reply message. Apparently this is the case because changing the message type solved your problem.

I'll have to test this to confirm...

Nicolas
_________________
Nicolas Maréchal
Senior Architect - Partner

NIMCONSULT Software Architecture Services (Belgium)
http://www.nimconsult.be
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » Request and Reply Message
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.