activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ritesh (JIRA)" <>
Subject [jira] [Created] (AMQ-4793) issue with messageSelector
Date Wed, 09 Oct 2013 18:38:44 GMT
ritesh created AMQ-4793:

             Summary: issue with messageSelector
                 Key: AMQ-4793
             Project: ActiveMQ
          Issue Type: Bug
          Components: Broker
            Reporter: ritesh

Having issue with message selector.
Message is already there in queue (I can confirm with activeMQ browser app). 
Create consumer with messageSelector and do consumer.receiveNoWait() always receive NULL message.

Have only three message in queue.

code sample...


            ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
            Connection connection= connectionFactory.createConnection();

            Session session= connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
            Destination queueDestination = session.createQueue("TestQueue");

             //using activeMq browser app i can see message is there with JMSCorrelationID=12345

             String messageSelector= "JMSCorrelationID = '12345'";
             MessageConsumer consumer= session.createConsumer(queueDestination,messageSelector);
             Message message= consumer.receiveNoWait();

                 // always return null message
                 //log message not found
           catch (Exception e)


But, if do this it’s works …

For(int i=0; i< 7; i++)
message= consumer.receiveNoWait();	

please help me what am i doing wrong?

This message was sent by Atlassian JIRA

View raw message