Description
When using the ActiveMQComponent to create a Camel component and you provide the broker URL as follows on the static method on ActiveMQComponent:
ActiveMQComponent activemq = activeMQComponent(""vm://localhost?broker.persistent=false&broker.useJmx=false");
It does not set a default ActiveMQConnectionFactory with that provided URL. So later when it creates a new connection factory it will fallback and use the default tcp://localhost:61616 url instead.
This code
public static ActiveMQComponent activeMQComponent(String brokerURL) { ActiveMQComponent answer = new ActiveMQComponent(); if (answer.getConfiguration() instanceof ActiveMQConfiguration) { ((ActiveMQConfiguration) answer.getConfiguration()) .setBrokerURL(brokerURL); } return answer; }
Should be changed to add a default connection factory as well
public static ActiveMQComponent activeMQComponent(String brokerURL) { ActiveMQComponent answer = new ActiveMQComponent(); if (answer.getConfiguration() instanceof ActiveMQConfiguration) { ((ActiveMQConfiguration) answer.getConfiguration()) .setBrokerURL(brokerURL); } // set the connection factory with the provided broker url answer.setConnectionFactory(ActiveMQConnectionFactory(brokerURL)); return answer; }
I dont have AMQ code checked out and cannot provided a patch. But it should be simple to improve as shown above.