Author |
Message
|
dnaren |
Posted: Wed Dec 11, 2002 10:40 am Post subject: How to Post reply to a queue on another queue manager? |
|
|
 Apprentice
Joined: 10 Aug 2001 Posts: 45 Location: Charlotte, NC
|
I have an application running on Machine S1 and connected to queue manager M1. It picks messages from Q1 (on M1). After processing the message, it should post the response to the queue (say Q2) specified in the message header. The problem is that queue Q2 is with different queue manager M2 on a different machine. The 'reply to queue' and the 'reply to queue manager' are specified in the request message header.
How can I make the application connect to different queue managers dynamically? Please note that I can only use 'queue manager name' and 'queue name' in the application.
MQSERVER variable approach is not good enough to connect to more than one queue manager. Is there anyway I can configure M1 (the queue manager) and/or the machine S1 to resolve other queue manager names dynamically?
TIA
Naren. |
|
Back to top |
|
 |
bduncan |
Posted: Wed Dec 11, 2002 10:59 am Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
Perhaps I'm misunderstanding what you are trying to do, but presumeably after your application on S1 does an MQGET to retrieve a message, it should just be able to disconnect from queue manager M1, and then do an MQCONN using the reply to queue manager name specified in the MQMD. Then MQOPEN the reply to queue. The downside is that it needs to connect/disconnect for every message it processes. But your application can't be connected to queue managers at once, so you're kinda limited to this solution. _________________ Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator |
|
Back to top |
|
 |
dnaren |
Posted: Wed Dec 11, 2002 11:37 am Post subject: |
|
|
 Apprentice
Joined: 10 Aug 2001 Posts: 45 Location: Charlotte, NC
|
Thanks for the reply!
How does the system resolve the queue manager names specified in the MQCONN calls? or How can we configure the queue manager or the server to achieve the desired queue manager name resolution? |
|
Back to top |
|
 |
clindsey |
Posted: Wed Dec 11, 2002 1:10 pm Post subject: |
|
|
Knight
Joined: 12 Jul 2002 Posts: 586 Location: Dallas, Tx
|
If you really want to connect to multiple QMs using client bindings, you will need to set up a client channel table that includes entries for all the queue managers. Then point to it with environment variables MQCHLLIB and MQCHLTAB. The set up is documented in the MQSeries Clients manual.
But, I think it would be better if your two QMs communicated. You can put them in a cluser or set up sender/receiver channels both ways with cluster queues or remote queue definitions. Then your client code only connects to a single queue manager and the transfer of messages between the QMs is transparent to the client app.
Charlie |
|
Back to top |
|
 |
DCawood |
Posted: Thu Dec 26, 2002 11:56 am Post subject: |
|
|
Newbie
Joined: 23 Oct 2001 Posts: 4
|
Maybe I am missing something too, but I think you should not worry about disconnecting from one queue manager and connecting to another, but simply create a local definition of a remote queue Q2 on M1 and have MQSeries handle transmitting the message to the correct queue and queue manager. Or have I misread the problem here? Your app isn't the consumer of the reply message is it?
Good Luck! |
|
Back to top |
|
 |
dnaren |
Posted: Thu Dec 26, 2002 12:05 pm Post subject: |
|
|
 Apprentice
Joined: 10 Aug 2001 Posts: 45 Location: Charlotte, NC
|
Well, I defined an alias for the remote queue manager (by defining a transmission queue with the name same as that of the remote queue manager M2 and a sender channel). The local queue manager M1 is able to handle the posts to the queue Q2 on the remote queue manager M2. |
|
Back to top |
|
 |
DCawood |
Posted: Thu Dec 26, 2002 12:18 pm Post subject: |
|
|
Newbie
Joined: 23 Oct 2001 Posts: 4
|
Excellent! That is using MQ to do the work instead of your app!  |
|
Back to top |
|
 |
|