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 » C# Problem Matching null Correlation ID's

Post new topic  Reply to topic
 C# Problem Matching null Correlation ID's « View previous topic :: View next topic » 
Author Message
chrisl_l
PostPosted: Mon Jul 12, 2010 3:20 am    Post subject: C# Problem Matching null Correlation ID's Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Mon Jul 12, 2010 3:36 am    Post subject: Reply with quote

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
View user's profile Send private message
chrisl_l
PostPosted: Mon Jul 12, 2010 5:22 am    Post subject: Reply with quote

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

MQSeries.net Forum Index » IBM MQ API Support » C# Problem Matching null Correlation ID's
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.