Author |
Message
|
rajmq |
Posted: Sun Jan 19, 2003 5:12 am Post subject: Request and Reply Message |
|
|
 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 |
|
 |
nimconsult |
Posted: Sun Jan 19, 2003 11:18 pm Post subject: Re: Request and Reply Message |
|
|
 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 |
|
 |
rajmq |
Posted: Mon Jan 20, 2003 11:35 pm Post subject: |
|
|
 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 |
|
 |
nimconsult |
Posted: Tue Jan 21, 2003 11:03 pm Post subject: |
|
|
 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 |
|
 |
rajmq |
Posted: Wed Jan 22, 2003 12:44 am Post subject: |
|
|
 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 |
|
 |
nimconsult |
Posted: Sun Jan 26, 2003 11:51 pm Post subject: |
|
|
 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 |
|
 |
|