Created
January 8, 2016 17:01
-
-
Save monodot/1eb87a9e50069cabf7dc to your computer and use it in GitHub Desktop.
Camel: subscribe to an ActiveMQ Advisory topic and route messages to a file so they can be easily read
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<beans xmlns="http://www.springframework.org/schema/beans" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation=" | |
http://www.springframework.org/schema/beans | |
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd | |
http://camel.apache.org/schema/spring | |
http://camel.apache.org/schema/spring/camel-spring.xsd"> | |
<camelContext xmlns="http://camel.apache.org/schema/spring"> | |
<route> | |
<from uri="activemq:topic:ActiveMQ.Advisory.Connection?mapJmsMessage=false" /> | |
<convertBodyTo type="java.lang.String"/> | |
<transform> | |
<simple>${in.body} --- </simple> | |
</transform> | |
<to uri="file://C:/temp/activemq/?fileExist=Append&fileName=ActiveMQ.Advisory.Connection-${date:now:yyyyMMdd}.txt" /> | |
</route> | |
</camelContext> | |
<bean id="activemq" | |
class="org.apache.activemq.camel.component.ActiveMQComponent"> | |
<property name="brokerURL" value="tcp://localhost:61616"/> | |
</bean> | |
</beans> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment