|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
C# Problem Matching null Correlation ID's |
« View previous topic :: View next topic » |
Author |
Message
|
chrisl_l |
Posted: Mon Jul 12, 2010 3:20 am Post subject: C# Problem Matching null Correlation ID's |
|
|
Newbie
Joined: 06 Apr 2010 Posts: 4
|
Hi,
Using C# we are trying to get messages from a queue, that do not have a correlation id set. Under certain circumstances there may be a mixture of messages, with/without a correlation id value, on the queue.
The problem is, the code is getting messages that have a correlation id set? I was under the impression the default values for MatchOptions was correlation id and message id. Even if we specify MQMO_MATCH_CORREL_ID as the match option, it still picks up messages that have a correlation id value.
The code we are using:
Code: |
int openOptions = MQC.MQOO_INPUT_SHARED |
MQC.MQOO_FAIL_IF_QUIESCING |
MQC.MQOO_INQUIRE;
m_rspQ = m_QManager.AccessQueue(listenQueueName, openOptions);
MQMessage message = new MQMessage();
message.CorrelationId = MQC.MQMI_NONE;
// Set the get message options..
MQGetMessageOptions gmo = new MQGetMessageOptions();
gmo.WaitInterval = waitMillis;
gmo.Options = gmo.Options | MQC.MQGMO_WAIT;
// Get a message
m_rspQ.Get(message, gmo);
|
In our case, the Get returns a message that has a value in correlation ID. Any thoughts/help would be appreciated.
Chris. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Jul 12, 2010 3:36 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Unfortunately asking to match MQCI_NONE means Match All Messages, not Match Messages Who's Correlation ID is empty.
If you really need to find messages that have an entirely empty CI, you need to read all messages on the queue and manually check. |
|
Back to top |
|
 |
chrisl_l |
Posted: Mon Jul 12, 2010 5:22 am Post subject: |
|
|
Newbie
Joined: 06 Apr 2010 Posts: 4
|
Thanks for the quick response, I should have noticed that in the documentation. Looks like I'll need to change the way they've developed the application.
Thanks again.
Chris. |
|
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
|
|
|
|