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 API Support » MQGET Options

Post new topic  Reply to topic
 MQGET Options « View previous topic :: View next topic » 
Author Message
krishs
PostPosted: Wed Feb 06, 2002 12:32 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
StefanSievert
PostPosted: Wed Feb 06, 2002 9:56 am    Post subject: Reply with quote

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
View user's profile Send private message
krishs
PostPosted: Mon Feb 11, 2002 5:56 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
krishs
PostPosted: Mon Feb 11, 2002 5:57 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
bob_buxton
PostPosted: Tue Feb 12, 2002 1:14 am    Post subject: Reply with quote

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
View user's profile Send private message
mqonnet
PostPosted: Thu Feb 21, 2002 1:07 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » MQGET Options
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.