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 » IBM MQ Java / JMS » how to put a reply messsage in a cluster queue

Post new topic  Reply to topic
 how to put a reply messsage in a cluster queue « View previous topic :: View next topic » 
Author Message
shifo_de
PostPosted: Mon Jan 25, 2010 3:31 am    Post subject: how to put a reply messsage in a cluster queue Reply with quote

Newbie

Joined: 25 Jan 2010
Posts: 4

Hello,


Currently I’m trying to write a java MQ client that has to read the request-message from a remote-queue (specified by host, port, channel etc.) and to sent the reply to a manager and queue that are given in „replyToQ“ and „replyToMgr“ fields of the request-message.

Reading the request-message is not a problem but I do not know how to access the cluster-queue using only the replyToQ and replyToMgr.

Client Program and the MQSeries Server are not on the same host.

Thanks in advance for any help to this question.
Back to top
View user's profile Send private message
Mr Butcher
PostPosted: Mon Jan 25, 2010 3:36 am    Post subject: Reply with quote

Padawan

Joined: 23 May 2005
Posts: 1716

you connect your java programm to QMGR X and read a message from one of that qmgr's queues. this message holds replytoq and replytoqmgr, so just "open that" on QMGR X, that qmgr should know about it. your program must not be aware of the fact that it is a cluster queue or not.
_________________
Regards, Butcher
Back to top
View user's profile Send private message
shifo_de
PostPosted: Mon Jan 25, 2010 4:21 am    Post subject: Reply with quote

Newbie

Joined: 25 Jan 2010
Posts: 4

Hello Butcher,

thanks a lot fort he prompt reply. I do this actually with the following code:

…
mqManager = new MQQueueManager(managerReceive, envReceive);
int openOptions = MQC.MQOO_INPUT_AS_Q_DEF;
mqQueue = mqManager.accessQueue(nameGet, openOptions);
MQMessage mqMessage = createMQGetMessage();
MQGetMessageOptions mqOptions = createMQGetOptions();
mqQueue.get(mqMessage, mqOptions);
…
// get the reply queue and manager
replytoq = mqMessage.replyToQueueName;
replytomgr = mqMessage.replyToQueueManagerName;

// Prepare the reply-message
…

MQQueue mqQueueReply =
mqManager.accessQueue(replytoq, MQC.MQOO_OUTPUT, replytomgr, null, null);
mqQueueReply.put(mqMessageReply);
…


Is this the right approach in such type of communication? Does it require having MQ WebSphere Client software installed on the client machine?



Best Regards
vasil
Back to top
View user's profile Send private message
Mr Butcher
PostPosted: Mon Jan 25, 2010 5:34 am    Post subject: Reply with quote

Padawan

Joined: 23 May 2005
Posts: 1716

you wrote

Quote:
Client Program and the MQSeries Server are not on the same host
.

yes, you need the mq client or the proper mq java classes.

sorry, i do not know much java language, so i can not verify your code.
_________________
Regards, Butcher
Back to top
View user's profile Send private message
shifo_de
PostPosted: Mon Jan 25, 2010 6:10 am    Post subject: Reply with quote

Newbie

Joined: 25 Jan 2010
Posts: 4

ok 10x, I will test it now and will keep you in touch

regards
vasil
Back to top
View user's profile Send private message
moonwalker
PostPosted: Tue Jan 26, 2010 10:26 pm    Post subject: Reply with quote

Apprentice

Joined: 02 Jun 2009
Posts: 42

Yes, Mr Butcher is absolutely correct. Just ensure that the queue manager you are talking about is part of the cluster. The queues that are shared in the cluster can be accessed just like you access the local queue of a queue manager.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Jan 27, 2010 4:57 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

moonwalker wrote:
The queues that are shared in the cluster can be accessed just like you access the local queue of a queue manager.


Well, that's half right.
Back to top
View user's profile Send private message
shifo_de
PostPosted: Wed Jan 27, 2010 6:56 am    Post subject: Reply with quote

Newbie

Joined: 25 Jan 2010
Posts: 4

Well thanks to all for the replays. I'm getting the point now the next question is:

Is it possible to run this pease of code on a separate host (were no qmanager is installed but MQ WebSphere Client only)?

Or with other words: Is it possible to send a reply to "cluster-queue" from a remote host?


Best Regards
vasil
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jan 27, 2010 7:10 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

shifo_de wrote:
Is it possible to run this pease of code on a separate host (were no qmanager is installed but MQ WebSphere Client only)?

Or with other words: Is it possible to send a reply to "cluster-queue" from a remote host?


As has been stated many, many times in here there's no link between how an application connects to a queue manager, and how that queue manager distributes messages.

So the discussion above is entirely correct about how messages move round inside a cluster. How you connect to a queue manager to put the reply, and indeed from where you connect, is a separate question.

Hence yes, you can send a reply from a remote host provided it's connected via client to a queue manager which participates in the cluster. Presumably using the same connection by which the code recieved the request it's replying to.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Jan 27, 2010 11:11 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Just remember that in order to be able to use the combination replytoQueue and replytoQueueManager you NEED to have a default path from the queue manager you are connected to, to the queue manager in the replytoQueueManager... Check the intercommunications and cluster manuals for more details.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » how to put a reply messsage in a cluster queue
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.