|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQGET Options |
« View previous topic :: View next topic » |
Author |
Message
|
krishs |
Posted: Wed Feb 06, 2002 12:32 am Post subject: |
|
|
Newbie
Joined: 03 Feb 2002 Posts: 8 Location: Chennai
|
From a Queue, I would like to get message with specific correlation id say =0 ,from a thread without sending any message.
I am setting the correlationid using following piece of code.
..............
..............
MQMessage retrievedMessage = new MQMessage();
for ( int i = 0 ; i < retrievedMessage.correlationId.length ; i++ )
retrievedMessage.correlationId[ i ] = 0 ;
MQGetMessageOptions gmo = new MQGetMessageOptions();
gmo.matchOptions = MQC.MQMO_MATCH_CORREL_ID;
tempQueue.get(retrievedMessage, gmo);
..................
..................
But I am getting a Message whose correlationId not = 0.
Can any one try this get a solution.
Thanx in advance.
Krishnan |
|
Back to top |
|
 |
StefanSievert |
Posted: Wed Feb 06, 2002 9:56 am Post subject: |
|
|
 Partisan
Joined: 28 Oct 2001 Posts: 333 Location: San Francisco
|
Krishnan,
my first impulse is to suggest that you use a correlId other then 0. MQCI_NONE is defined as all 0's, which means that correlId will be ignored on your GET, giving you the first available message on the queue.
I wouldn't be surprised if this is the cause for your application's behavior.If it is, then it works just as designed.
HTH,
Stefan
_________________
Stefan Sievert
IBM Certified * MQSeries
[ This Message was edited by: StefanSievert on 2002-02-06 09:57 ] |
|
Back to top |
|
 |
krishs |
Posted: Mon Feb 11, 2002 5:56 am Post subject: |
|
|
Newbie
Joined: 03 Feb 2002 Posts: 8 Location: Chennai
|
Dear Stefan,
Thanx a lot for your support. I would like to wait for a predefined correlationid, How can i choose a unique predefined correlationid.
This will be much useful for me.
Kind Rgds,
Krishs
Quote: |
On 2002-02-06 09:56, StefanSievert wrote:
Krishnan,
my first impulse is to suggest that you use a correlId other then 0. MQCI_NONE is defined as all 0's, which means that correlId will be ignored on your GET, giving you the first available message on the queue.
I wouldn't be surprised if this is the cause for your application's behavior.If it is, then it works just as designed.
HTH,
Stefan
_________________
Stefan Sievert
IBM Certified * MQSeries
[ This Message was edited by: StefanSievert on 2002-02-06 09:57 ]
|
|
|
Back to top |
|
 |
krishs |
Posted: Mon Feb 11, 2002 5:57 am Post subject: |
|
|
Newbie
Joined: 03 Feb 2002 Posts: 8 Location: Chennai
|
Dear Stefan,
Thanx a lot for your support. I would like to wait for a predefined correlationid, How can i choose a unique predefined correlationid.
This will be much useful for me.
Kind Rgds,
Krishs
Quote: |
On 2002-02-06 09:56, StefanSievert wrote:
Krishnan,
my first impulse is to suggest that you use a correlId other then 0. MQCI_NONE is defined as all 0's, which means that correlId will be ignored on your GET, giving you the first available message on the queue.
I wouldn't be surprised if this is the cause for your application's behavior.If it is, then it works just as designed.
HTH,
Stefan
_________________
Stefan Sievert
IBM Certified * MQSeries
[ This Message was edited by: StefanSievert on 2002-02-06 09:57 ]
|
|
|
Back to top |
|
 |
bob_buxton |
Posted: Tue Feb 12, 2002 1:14 am Post subject: |
|
|
 Master
Joined: 23 Aug 2001 Posts: 266 Location: England
|
You can define anything you like to be the correlid though you should probably avoid values that could be generated as meesage ids (see programming reference).
If you want an already defined constant you could use MQCI_NEW_SESSION
Bob |
|
Back to top |
|
 |
mqonnet |
Posted: Thu Feb 21, 2002 1:07 pm Post subject: |
|
|
 Grand Master
Joined: 18 Feb 2002 Posts: 1114 Location: Boston, Ma, Usa.
|
Hi Krish,
I would go with specifying MQPMO_NEW_CORREL_ID in the put message options. This option forces the Queue manager to generate a New Unique Correl id. After the Mqput call, you could copy the correl id value returned by the QM in either a variable or an array(depending on your apps' requirement), and then supply this value on the Mqget call to retrieve the message with this specific Correl id.
Cheers.
Kumar
_________________ IBM Certified WebSphere MQ V5.3 Developer
IBM Certified WebSphere MQ V5.3 Solution Designer
IBM Certified WebSphere MQ V5.3 System Administrator |
|
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
|
|
|
|