|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQclient |
« View previous topic :: View next topic » |
Author |
Message
|
btdo |
Posted: Tue Jun 28, 2005 12:07 pm Post subject: MQclient |
|
|
Novice
Joined: 03 Jun 2005 Posts: 19
|
I am writing a client application in VB.net that would send a message to the server and the server then would send a message back. For example, if I put a message in a Output queue as "TIME", I would receive a message from the input queue as "The time is now 15:45:57.80" . This part is working
A problem occurs when I have two clients running my application that are using the same input and output queues. For example, if client 1 put a message at 3:30 and client 2 put another message at 3:40 to the same Output queue. Then at 3:50 client 2 make a Get call to the input Queue, it receives the "The time is now 3:30" message which suppose to go to client 1 not client 2. And if client 1 make a get call, it receives the message "the time is now 3:40".
I guess my question is "is there a way to separate messages from different users ? ". I know there is message id and correlation id, but i am not sure how they work either, can someone explain them to me ?? or better yet, a sample code would help. Thanks |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jun 28, 2005 12:44 pm Post subject: Re: MQclient |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
btdo wrote: |
I guess my question is "is there a way to separate messages from different users ? ". |
Yes. Use Message Id and Correlation Id in a standard, well documented, request/reply pattern.
btdo wrote: |
I know there is message id and correlation id, but i am not sure how they work either, can someone explain them to me ?? or better yet, a sample code would help. Thanks |
The Application Programming Guide has explicit information about Request/Reply patterns.
The MQ Sample Code has explicit examples of request/reply processing in multiple languages. Try the Samples directory on your MQ machine. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
btdo |
Posted: Wed Jun 29, 2005 10:16 am Post subject: MQClient session |
|
|
Novice
Joined: 03 Jun 2005 Posts: 19
|
Hi
By using the message id and correlid, would I be required to write some code for user exit ?. Is there a way to get around this ? |
|
Back to top |
|
 |
WillH |
Posted: Wed Jun 29, 2005 11:08 am Post subject: |
|
|
Novice
Joined: 15 Jun 2005 Posts: 23
|
No user exit required. You populate those fields in the MQMD message descriptor that you pass to the MQGET call. |
|
Back to top |
|
 |
zpat |
Posted: Wed Jun 29, 2005 11:09 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
It's easy, you just save the msgid generated by the MQPUT and specify it on the MQGET as the correlid.
Providing the server application turns it around and sends the inbound message id on the reply messages as correlid.
If it doesn't then you have to have one reply queue per program (and get without specifying correlid) |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|