activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sreekar <trinadhnal...@gmail.com>
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 - END:

                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 (
                                               amqMessageToSend.getMessage()
);

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

  CONSUMER - END:
         
                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
from CONSUMER-END.

Is there anything wrong with the syntax ?

http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/selector/SelectorTest.java?view=markup

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,
Sreekar 

--
View this message in context: http://activemq.2283324.n4.nabble.com/Unable-to-filter-messages-based-on-correlationID-tp4579216p4579216.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message