JMS Spring Selector Magic

I was happy to discover that Spring makes it so easy to select jms messages from a queue using the message’s header field values and property values. Just add in your own messageSelector expression <property name=”messageSelector” value=”Jurisdiction = ‘BC'” />. See for more explanation of the expression syntax.

<bean id="brokerRequestNotificationMessageContainer" class="org.springframework.jms.listener.SimpleMessageListenerContainer102">
	<property name="connectionFactory" ref="brokerConnectionFactory" />
	<property name="destination" ref="ehrBrokerRequestQueue" />
	<property name="messageListener" ref="requestMessageListener" />
	<property name="concurrentConsumers" value="${}" />
	<property name="messageSelector" value="Jurisdiction = 'BC'" />

It's only fair to share...
Share on Facebook
Tweet about this on Twitter
Share on LinkedIn

Leave a Reply