Author |
Message
|
lenkite |
Posted: Mon Dec 19, 2005 3:37 am Post subject: How to Receive messages on remote Q using local QM? |
|
|
Newbie
Joined: 19 Dec 2005 Posts: 3
|
Hi all,
MQ JMS Java allows a JMS application to connect to a local QM, and put a message which then can be sent to a remote QM. This is possible by :
* Construct a sender channel on the local QM that uses a transmission queue.
* Construct the corresponding receiver channel on the remote QM.
* Connect to local QM in the standard JMS manner (using TCP transport type) and obtain a QueueSession say qSession.
* Get an MQQueue: rQueue = qSession.createQueue(<remoteQueueName>)
* Call rQueue.setBaseQueueManagerName(<remoteQMName>)
* Create a QueueSender and send a message in the normal way.
However, this approach doesn't seem to work for the receive case. For the receive case, I have created a 'Requester' channel at the local QM side and a 'Server' channel at the remote QM side. Unfortunately, when I try to create a QueueReceiver I get this error:
"MQJMS1017: non-local MQ queue not valid for receiving or browsing"
I am confused here. I thought the very point of 'Requester' and 'Server' channel configurations was to enable queue-access in this manner.
All help much appreciated!
[/b] |
|
Back to top |
|
 |
Mr Butcher |
Posted: Mon Dec 19, 2005 3:40 am Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
this is basic mq design. you can not read from a remotequeue definition.
messages are put to remotequeue definitions so mq knows about the destination of the message. the message is then routed by mq until it has reached its final destination (a local queue on a specific queuemanager).
you have to connect to that queuemanager and read from that local queue if you like to retrieve the messages. _________________ Regards, Butcher |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Dec 19, 2005 4:35 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Also, an application should never be aware of the nature of the channels that connect two queue managers. That would severely break the logical isolation between the two applications that MQ makes possible. An application should have no idea where or how the receivers of it's messages are connected to the MQ network - either locally, remotely, in parallel, in a cluster, or across unreliable WAN links. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
lenkite |
Posted: Mon Dec 19, 2005 11:51 pm Post subject: I am already aware of that. |
|
|
Newbie
Joined: 19 Dec 2005 Posts: 3
|
Hi,
Thanks for your responses. But I am already aware of the issues they address. In the first place, this is not a remote queue definition.
Secondly, I perfectly understand that a well-designed application mustn't be aware of the nature of channels - it should be separate from configuration details.
But unforutnately real-world legacy constraints dictate this approach. This is not an application I am coding, but an adapter that can be configured dynamically to handle dirty integration scenarios.
But thanks anyways.. |
|
Back to top |
|
 |
wschutz |
Posted: Tue Dec 20, 2005 3:01 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Quote: |
the first place, this is not a remote queue definition. |
You're correct, but it is still a "remote queue" (ie, a queue which is not local to the qmgr you are connected to) and you can't GET from anything other than a local queue).
Quote: |
This is not an application I am coding, but an adapter that can be configured dynamically to handle dirty integration scenarios.
|
So can you configure it to use MQ client channels? Then you can get the message from the queue manager which hosts the queue. _________________ -wayne |
|
Back to top |
|
 |
lenkite |
Posted: Tue Dec 20, 2005 9:49 pm Post subject: |
|
|
Newbie
Joined: 19 Dec 2005 Posts: 3
|
Well, yes there is no workaround here. I just wanted to confirm that.
Thanks. |
|
Back to top |
|
 |
bower5932 |
Posted: Wed Dec 21, 2005 7:08 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
lenkite wrote: |
Well, yes there is no workaround here. I just wanted to confirm that. |
I'd say that there is a workaround - use wschutz's suggestion of a client connection to the qmgr. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Dec 21, 2005 7:16 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Or move the queue to the local queue manager... _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|