The Camel ActiveMQComponent should default create ActiveMQConnectionFactory
with the provided broker url
--------------------------------------------------------------------------------------------------------
Key: AMQ-3138
URL: https://issues.apache.org/jira/browse/AMQ-3138
Project: ActiveMQ
Issue Type: Improvement
Components: Broker
Affects Versions: 5.4.2
Reporter: Claus Ibsen
When using the ActiveMQComponent to create a Camel component and you provide
the broker URL as follows on the static method on ActiveMQComponent:
{code}
ActiveMQComponent activemq =
activeMQComponent(""vm://localhost?broker.persistent=false&broker.useJmx=false");
{code}
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
{code}
public static ActiveMQComponent activeMQComponent(String brokerURL) {
ActiveMQComponent answer = new ActiveMQComponent();
if (answer.getConfiguration() instanceof ActiveMQConfiguration) {
((ActiveMQConfiguration) answer.getConfiguration())
.setBrokerURL(brokerURL);
}
return answer;
}
{code}
Should be changed to add a default connection factory as well
{code}
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;
}
{code}
I dont have AMQ code checked out and cannot provided a patch. But it should be
simple to improve as shown above.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.