With the following container configuration, the jms:message-driven-channel-adapter behaves as expected.
But on the other hand, jms:inbound-channel-adapter ignores the selector set in the container and picks up all the messages sent to the queue regardless what value in the header property. A container is allowed to be configured in an JMS inbound channel adapter but behavior is not consistent. Is it improper use of JMS inbound channel adapter? or is it an issue? or should configuring a container in JMS inbound channel adapter be dis-allowed?
<jms:message-driven-channel-adapter container="myContainer" channel="stout"/>
<stream:stdout-channel-adapter id="stout" append-newline="true"/>
<bean id="myContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="connectionFactory" ref="connectionFactory" />
<property name="destinationName" value="hello.queue" />
<property name="messageSelector" value="myHeader = 'hello'"/>
inbound channel adapter configuration:
It would be nice to have an attribute for message selector. I would like to confirm with you the correct behaviors of the two JMS channel adapters before I open the issue for the selector.
<jms:inbound-channel-adapter id="jmsin" container="myContainer" destination-name="hello.queue"