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 » Error creating consumer with message selector (C++)

Post new topic  Reply to topic
 Error creating consumer with message selector (C++) « View previous topic :: View next topic » 
Author Message
magr01
PostPosted: Mon Jul 02, 2012 9:15 pm    Post subject: Error creating consumer with message selector (C++) Reply with quote

Newbie

Joined: 15 Nov 2011
Posts: 6

Hello,

I am trying to create a consumer with a message selector (I am in a multi-threaded application and I sending a request message and only want to receive the reply intended for that request).
However, I get an error when executing this code:

producer.send(textMsg, 30000);
session.createConsumer(destination, textMsg.getJMSMessageID());

The error is XMS_E_PROTOCOL_ERROR (no further information)


Anyone has an idea what this can be??

BR

Martin
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Jul 03, 2012 6:12 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Check out the samples. Looks to me that your selector is wrong. It only contains the messageID and nothing else. If you are using XMS this is wrong.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
magr01
PostPosted: Tue Jul 03, 2012 10:26 pm    Post subject: Reply with quote

Newbie

Joined: 15 Nov 2011
Posts: 6

Hi,

I am using XMS.

Changed to the code to the following instead:

string msgID = (textMsg.getJMSMessageID()).c_str();
string msgSelector = "JMSCorrelationID = " + msgID;
session.createConsumer(destination, msgSelector);

This is however making the program crash.
Cannot figure out what I am doing wrong.

Any help would be really appreciated

BR

Martin
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Jul 04, 2012 6:41 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

magr01 wrote:
Hi,

I am using XMS.

Changed to the code to the following instead:

Code:
string msgID = (textMsg.getJMSMessageID()).c_str();
string msgSelector = "JMSCorrelationID = " + msgID;
session.createConsumer(destination, msgSelector);


This is however making the program crash.
Cannot figure out what I am doing wrong.

Any help would be really appreciated

BR

Martin


Try and substitute following lines
Code:
string msgID = textMsg.getJMSMessageID();
string msgSelector = "JMSCorrelationID = '" + msgID + "'";

This method is already supposed to return a string... don't know what your instance method c_str() would do when operated on a string...
Note: '" single quote + string terminator
"'" string start, single quote, string terminator
Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
fjb_saper
PostPosted: Wed Jul 04, 2012 6:47 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

fjb_saper wrote:
magr01 wrote:
Hi,

I am using XMS.

Changed to the code to the following instead:

Code:
string msgID = (textMsg.getJMSMessageID()).c_str();
string msgSelector = "JMSCorrelationID = " + msgID;
session.createConsumer(destination, msgSelector);


This is however making the program crash.
Cannot figure out what I am doing wrong.

Any help would be really appreciated

BR

Martin


Try and substitute following lines
Code:
string msgID = textMsg.getJMSMessageID();
string msgSelector = "JMSCorrelationID = '" + msgID + "'";

This method is already supposed to return a string... don't know what your instance method c_str() would do when operated on a string...
Note: '" single quote + string terminator
"'" string start, single quote, string terminator

Your msgSelector content should look like JMSCorrelationID = 'ID:af0c....00'
note that here the .... replace more of hex representation of bytes in the array...
Have fun

_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
magr01
PostPosted: Wed Jul 04, 2012 11:19 pm    Post subject: Reply with quote

Newbie

Joined: 15 Nov 2011
Posts: 6

Hi,

Seems like I got it to work.

Thank you very much for your help.

BR

Martin
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 » Error creating consumer with message selector (C++)
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.