activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sreekar <>
Subject Unable to filter messages based on correlationID...
Date Mon, 23 Apr 2012 01:36:40 GMT
Hi Guyz,

I have tried to use the message_selector using the C++ client.
But am unable to filter the messages based on correlationID.

Without selector, i am able to receive all the messages.
(It can be assured that connection, session, destination, consumer, producer
are created correctly)

Things which i tried:

                producer = session->createProducer (TEST_QUEUE);
       // In actual case i am doing the following thing in a loop,
       // correlationID is set using a counter variable.
                TextMessage* textMessage = session->createTextMessage (

                // set the unique-identifiers for the message
                textMessage->setCMSCorrelationID ( "23781729" );
                producer->send ( textMessage, PERSISTENT);

                std::string filter = "JMSCorrelationID = '23781729'";
                session->createConsumer (TEST_QUEUE, filter);

I am sending around 5000 messages from PRODUCER-END and am recieving them
successfully at CONSUMER-END when i created consumer without any selector
("JMSCorrelationID = '23781729'");

I tried creating consumer with selector (("JMSCorrelationID = '23781729'"
and "CMSCorrelationID = '23781729'")), but i could not receive any messages

Is there anything wrong with the syntax ?

The syntax mentioned in above (for message-id) is like :
"JMSMessageID = 'id:test:1:1:1:1'"

In a similar lines, i tried to filter with correlation-ID (which is also a
JMS property that can be set by user).

Any suggestions would be appreciable.

Thanks & Regards,

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message