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 » Clustering » What's the difference between replying and putting?

Post new topic  Reply to topic
 What's the difference between replying and putting? « View previous topic :: View next topic » 
Author Message
issac
PostPosted: Wed Jun 05, 2013 6:02 pm    Post subject: What's the difference between replying and putting? Reply with quote

Disciple

Joined: 02 Oct 2008
Posts: 158
Location: Shanghai

Hello,

In the infocenter of WMQ V7.0.1,

http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.csqzah.doc/qc10820_.htm

it lists several examples :

Quote:

Putting from a queue manager outside a cluster
Replying to a queue manager outside the cluster
Putting from a queue manager outside the cluster - alternative techniques
Putting to a queue manager outside the cluster
Replying from a queue manager outside the cluster
Putting across clusters


Quite surprisingly, I found Replying to a queue manager outside the cluster and Putting to a queue manager outside the cluster are totally different configurations.

The first question that bothers me is, what is "replying" anyway? I thought it means to put msg id into correlation id and send back. am i right? If so why couldn't I just build the response msg then send it in the way described in "Putting to a queue manager outside the cluster"?

The second question is, I can't make it work in an experiment for "Replying to a queue manager outside the cluster". It asks me to
Code:

DEFINE QREMOTE(QM3.ALIAS) RNAME(' ') RQMNAME(QM3) CLUSTER(DEMO)


That's ok. My request sender could just set reply-to-qmgr to QM3.ALIAS. But, my responder app, namely app2, is connected to QM2 (see to figure 1 here http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.csqzah.doc/qc10830_.htm), now that in the request msg, I've found both replyToQueueName and replyToQmgr, how could I put the response msg to the replyToQmgr? Should I just create another connection to the replyToQmgr? Or would MQ do it for me in anyway?

Code:

private void process(String[] args) throws IllegalOptionValueException, UnknownOptionException, MQException, IOException {
      this.parseCommandLineArguments(args);
      this.buildMQConnection_BASE_API();
      ProgressLog.progress_LV2("Establishing connection...");
      final MQQueueManager qmgr = new MQQueueManager(pstr("qmgr"));
      // ------------------------------------------------------
      ProgressLog.progress_LV1("Waiting for request msg...");
      final MQQueue reqQ = qmgr.accessQueue(pstr("queue"), MQConstants.MQOO_INPUT_SHARED);
      //read the request msg
      final MQMessage reqMsg = new MQMessage();
      reqQ.get(reqMsg, new MQGetMessageOptions());
      ProgressLog.progress_LV2("Request msg arrived.");
      byte[] reqMsgId = this.printMQMessage(reqMsg);
      //-------------------------------------------------------------
      //build the response msg
      ProgressLog.progress_LV1("Building then send response msg...");
      final MQMessage resMsg = new MQMessage();
      resMsg.correlationId=reqMsgId;
      final MQQueue resQ = qmgr.accessQueue(reqMsg.replyToQueueName, MQConstants.MQOO_OUTPUT);
      //TODO: WHAT SHOULD I DO WITH THE replyToQueueManagerName? It's not the one I've connected to.
   }



[/b]
_________________
Bazinga!
Back to top
View user's profile Send private message
bruce2359
PostPosted: Wed Jun 05, 2013 6:58 pm    Post subject: Re: What's the difference between replying and putting? Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9394
Location: US: west coast, almost. Otherwise, enroute.

issac wrote:

The first question that bothers me is, what is "replying" anyway? I thought it means to put msg id into correlation id and send back. am i right? If so why couldn't I just build the response msg then send it in the way described in "Putting to a queue manager outside the cluster"?

First, don't let this kind of thing bother you.

Next...

Request-reply is an application design model, with the requesting application creating a request message, and the responding application creating a reply message - as you've described the use of MsgId and CorrelId. In this paradigm, there is a requester application, and a responder application. Both put messages.

The verbs (API calls) used in the MQI are MQPUT and MQGET; so yes, in less or more technically accurate terminology, one application puts a message...

Lastly, don't let this kind of thing bother you. There are far more bothersome things in MQ, and elsewhere in the ether.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
exerk
PostPosted: Wed Jun 05, 2013 11:50 pm    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

Does THIS help you?
_________________
It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys.
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Thu Jun 06, 2013 4:08 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7717

Its different in that putting to a queue outside of the cluster means you can pre define a remote queue IN the cluster that points specifically to that one queue OUTSIDE of the cluster.

Replying means your replying app should be looking at the values of the Reply To Q and Reply To QM in the MQMD of the request message. Since you don't know what the Reply Q name is going to be in all cases, you can't predefine a remote q IN the cluster to point to the as-yet-unknown-to-you reply queue OUTSIDE of the cluster. Think a requesting app that uses a dynamic queue for its Reply Q.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » Clustering » What's the difference between replying and putting?
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.