This content has been marked as final.
Show 2 replies
-
1. Re: Camel and HornetQ ?
davsclaus Jan 10, 2012 9:17 AM (in response to labo32_delaboe)Hi
If JBoss provides a HornetMQ component, then they may have some documentation how to do that.
However HornetMQ should be a generic JMS compliant broker, so you should just be able to use the camel-jms component, and configure it's JMS ConnectionFactory.
If you use a Spring XML file to configure your application, then you can configure this in the XML file.
See the section Configuring different JMS providers at
-
2. Re: Camel and HornetQ ?
labo32_delaboe Jan 12, 2012 7:30 AM (in response to davsclaus)That's it.
1) Start JBoss with
standalone.bat --server-config=standalone-preview.xml
to enable hornetQ messaging
2) Route
camel config
<camelContext trace="false" xmlns="http://camel.apache.org/schema/spring"> <routeBuilder ref="jmsRoute"></routeBuilder> </camelContext> <bean id="jmsRoute" class="test.JMSRoute"></bean> <bean id="hornetq" class="org.apache.camel.component.jms.JmsComponent"> <property name="connectionFactory" ref="myConnectionFactory"></property> </bean> <jee:jndi-lookup id="myConnectionFactory" jndi-name="java:/ConnectionFactory"></jee:jndi-lookup>
route
package test; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.spring.Main; public class JMSRoute extends RouteBuilder { public static void main(String[] args) throws Exception { new Main().run(args); } public void configure() { from("quartz://timerName?cron=0/20 * * * * ?") .setBody(constant("test")) .to("log:IN?showHeaders=true") .to("hornetq:queue:testQueue") .to("log:IN?showHeaders=true"); } }
Thanks
labo