Thanks Mark.
With the following container configuration, the jms:message-driven-channel-adapter behaves as expected.
Code:
<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'"/>
</bean>
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?
inbound channel adapter configuration:
Code:
<jms:inbound-channel-adapter id="jmsin" container="myContainer" destination-name="hello.queue"
channel="stout">
<integration:poller>
<integration:interval-trigger interval="1"
time-unit="SECONDS" />
</integration:poller>
</jms:inbound-channel-adapter>
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.
Ron