activemq.xml embedded camel context cannot resolve a broker if port other than
default(61616) is used for tcp transport
------------------------------------------------------------------------------------------------------------------------
Key: AMQ-1895
URL: https://issues.apache.org/activemq/browse/AMQ-1895
Project: ActiveMQ
Issue Type: Bug
Components: Broker
Affects Versions: 5.1.0
Environment: all
Reporter: Gary Tully
Assignee: Gary Tully
Fix For: 5.2.0
The camel context defined in acrtivemq.xml does not specify a camel
activeMQComponent (where a brokerUrl could be specified) and hence false back
to the use of the default broker URL from ActiveMQConnectionFactory. This
breaks down when a non default port is specified for the broker.
The result is the camel context continually retrying to connect to a non
existent port.
It may make sense to pull the camel context out of the default activemq.xml
altogether but with it present, it may make sense to have the camel
activmqcomponent use a default broker url that uses the vm transport as the
context will always be embedded in a broker.
One issue with the use of vm transport is that the first use of the transport
creates an embedded broker. With the xbean xml, the camel context bean starts
before the brokerService so the result is two brokers.
It would be usefull if the vm transport url allowed an option to wait for a
broker to start so that the camel context can reliably use the vm transport
without the possibility of creating a separate embedded broker.
Something like the following would work:
{code} vm://localhost?waitForStart=10000&create=false {code}
In this way, the camel embedded connection factory would wait up to 10 seconds
for the localhost broker to start and fail with an exception (b/c create=false)
in the event that the broker does not start within that time.
This would be a sensible default url for the activemq camel component in the
acrtivemq.xml such that it is independent of transport options used by the
broker.
(The spring depends-on workaround for this ordering dependency only works in a
complete spring context)
{code}
<bean id="activemq"
class="org.apache.activemq.camel.component.ActiveMQComponent" >
<property name="brokerURL"
value="vm://localhost?waitForStart=10000&create=false" />
</bean>
{code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.