Hi everyone,

I'm trying to send a jms message to a remote activemq broker on a remote
servicemix instance. I believe I would first need to create an
ActiveMQConnectionFactory object and add that to the default camelContext.
If this is correct, how do I access the default camelContext (which is just
a spring bean), from my routebuilder class? I was thinking something like:

@Component
public class JettyRouteBuilder extends SpringRouteBuilder {

    @Override
    public void configure() {
       camelContext.addComponent("activemq",
activeMQComponent("tcp://10.1.2.3:61616"));
       from("jetty:http://0.0.0.0:8888/mytestservice";).to("activemq");
       ...

I'm not sure about the syntax in the .to(...) method or how i extract
camelContext from serviceMix since I've defined it in:

<beans xmlns="http://www.springframework.org/schema/beans";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       xmlns:camel="http://camel.apache.org/schema/spring";
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
       http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
       http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd";>


    <camel:camelContext id="camel5">
        <packageScan>
            <package>org.apache.servicemix.examples.camel</package>
        </packageScan>
    </camel:camelContext>

</beans>

Thanks in advance for any help!



--
View this message in context: 
http://servicemix.396122.n5.nabble.com/How-to-create-a-camel-route-to-remote-ActiveMQ-broker-tp5722843.html
Sent from the ServiceMix - Dev mailing list archive at Nabble.com.

Reply via email to