I'm trying to add the correct tcp:// connection url to the camel context in a 
standalone/Java DSL camel app and am using a boot() method that was pulled from 
example code on the camel site. In my boot() method I'm trying to add the 
correct URL to the camel context but it's not getting added. When the code runs 
its still looking for a broker on localhost instead of the broker server I 
passed. How do I get the URL to be picked up in the context so my Java DSL 
route can connect to the correct server?

@SuppressWarnings("static-access")
public void boot() throws Exception {
        // create a Main instance
        main = new Main();
        // enable hangup support so you can press ctrl + c to terminate the JVM
        main.enableHangupSupport();
        ActiveMQComponent amq = new ActiveMQComponent();

        main.getOrCreateCamelContext().addComponent(
        "activemq",
        amq.activeMQComponent("tcp://ourbrokerserver.workplace.com:61616"));
        //ActiveMQComponent amq = new ActiveMQComponent();

        // add routes
        main.addRouteBuilder(new EtlProducerRouteBuilder());
        // run until you terminate the JVM
        System.out.println("Starting Camel. Use ctrl + c to terminate the 
JVM.\n");
        main.run();
    }

Reply via email to