Programming Guy
Programming Guy

Reputation: 7461

How to receive messages from ActiveMQ with JMSTemplate and a selector?

I'm trying to grab messages on a persistent activemq queue.

If I call

jmsTemplate.receive("queue.response")

I get a message. However if I call

jmsTemplate.receiveSelected("queue.response", "JMSCorrelationId='1854044'")

I time out while waiting.

I'm looking at the queue using the ActiveMQ web console and I can see that the messages are there ready to be consumed. The correlation ids are visible in the console and I can also see them in the messages I receive with the straight receive("queue..") call.

Presumably I'm doing something wrong with my actual selector, but every example I can find looks like what I've got.

Any ideas what I'm doing wrong?

Upvotes: 2

Views: 9294

Answers (1)

Programming Guy
Programming Guy

Reputation: 7461

Facepalm! JMSCorrelationID is case sensitive. I was trying to use JMSCorrelationId...

Upvotes: 6

Related Questions