INTSAMPLES-106 JMS: Eliminate Hijack of stdout

Caused unusual behavior when exceptions occurred, or debug
logging enabled.

Now uses Spring profiles to route the output to a QueueChannel
instead.
This commit is contained in:
Gary Russell
2013-02-20 16:12:55 -05:00
committed by Gunnar Hillert
parent 078a72eeeb
commit 99fe63dc35
5 changed files with 64 additions and 43 deletions

View File

@@ -13,12 +13,27 @@
http://www.springframework.org/schema/integration/stream
http://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd">
<jms:message-driven-channel-adapter id="jmsin"
<jms:message-driven-channel-adapter id="jmsIn"
destination="requestQueue"
channel="jmsinToStdoutChannel"/>
channel="jmsInChannel" />
<channel id="jmsinToStdoutChannel"/>
<channel id="jmsInChannel" />
<stream:stdout-channel-adapter id="stdout" channel="jmsinToStdoutChannel" append-newline="true"/>
<beans:beans profile="default">
<stream:stdout-channel-adapter id="stdout" channel="jmsInChannel" append-newline="true"/>
</beans:beans>
<beans:beans profile="testCase">
<bridge input-channel="jmsInChannel" output-channel="queueChannel"/>
<channel id="queueChannel">
<queue />
</channel>
</beans:beans>
</beans:beans>

View File

@@ -21,10 +21,25 @@
<jms:outbound-gateway request-channel="stdinToJmsoutChannel"
request-destination="requestQueue"
reply-channel="jmsReplyToStdoutChannel"/>
reply-channel="jmsReplyChannel"/>
<channel id="jmsReplyToStdoutChannel"/>
<channel id="jmsReplyChannel" />
<stream:stdout-channel-adapter channel="jmsReplyToStdoutChannel" append-newline="true"/>
<beans:beans profile="default">
<stream:stdout-channel-adapter channel="jmsReplyChannel" append-newline="true"/>
</beans:beans>
<beans:beans profile="testCase">
<bridge input-channel="jmsReplyChannel" output-channel="queueChannel"/>
<channel id="queueChannel">
<queue />
</channel>
</beans:beans>
</beans:beans>