Are you acknowledging your messages as you finish consuming them?

Also, what's the reason you're using a selector on the JMSMessageId?

Can you describe what messages you "can find" (and what "find" means) and
which ones you can't, as well as where?

Tim
On Dec 10, 2015 4:06 PM, "dabayev" <daba...@fortress.com> wrote:

> Hello,
>
> I have a very simple setup. I am using ActiveMQ 5.11.1 and have a simple
> persistent Queue where I publish messages. I am running a utility to update
> headers on these messages.
>
> I simply make my connection, then I start it, get the session, create the
> Queue and then create the consumer using a simple JMSMessageID selector.
>
> connectionFactory = new ActiveMQConnectionFactory(username, password, url);
> connection = connectionFactory.createConnection();
> connection.start();
> session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
> destination = session.createQueue(queue);
> String messageFilter = JMSMessageID  + " = '" + messageId + "'";
> MessageConsumer consumer = session.createConsumer(destination,
> messageFilter);
> TextMessage message = (TextMessage)consumer.receive(200);
>
> The problem is once I reach a certain number of pendingMessages on the
> Queue, my consumer.receive does not return my message, even though it is
> shown on the management console. I have been breaking my head and playing
> with different configs and still no luck.
>
> Note: I do not have any consumers attached to the Queue when I run my
> utility. More over, its only the latest messages that I cannot find so it
> feels likce receive is looking only at the first n number of messages and
> if
> JMSMessageID is no there then it returns null.
>
> Can someone please help me.
>
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Issue-with-MessageConsumer-and-MessageSelector-tp4704870.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Reply via email to