How do I get my Camel route to connect to the secured broker in Fuse ESB 7.1

Solution Verified - Updated -

Environment

  • Fuse ESB Enterprise 7.1
  • Fuse Mediation Router

Issue

  • When migrating a Camel bundle from Fuse ESB 4.x to Fuse ESB Enterprise 7.1 you might receive the following error:
07:32:58,182 | INFO  | NAPSHOT-thread-1 | TransportConnector               | 125 - org.apache.activemq.activemq-core - 5.7.0.fuse-71-047 | Connector vm://fusemq Started
07:32:58,229 | WARN  |  vm://fusemq#1-1 | TransportConnection              | 125 - org.apache.activemq.activemq-core - 5.7.0.fuse-71-047 | Failed to add Connection ID:OIT-DEV-D-018-50404-1360942104910-3:1, reason: java.lang.SecurityException: User name [null] or password is invalid.
07:32:58,229 | WARN  | xception Handler | Transport                        | 125 - org.apache.activemq.activemq-core - 5.7.0.fuse-71-047 | Transport Connection to: vm://fusemq#0 failed: org.apache.activemq.transport.TransportDisposedIOException: Peer (vm://fusemq#0) disposed.
07:32:58,229 | INFO  | NAPSHOT-thread-1 | TransportConnector               | 125 - org.apache.activemq.activemq-core - 5.7.0.fuse-71-047 | Connector vm://fusemq Stopped

Resolution

You can provide the broker credentials in the activemq configuration bean of your camel route as follows:

<bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
    <property name="brokerURL" value="failover:tcp://localhost:61616"/>
    <property name="userName" value="admin"/>
    <property name="password" value="admin"/>
  </bean>

Root Cause

The broker shipped in Fuse ESB 7.1 has security enabled out-of-the-box so the client needs to provide the correct credentials when establishing the connection. An alternative is to disable the broker security as described in the Disable Fuse MQ Enterprise 7.0.2 default security for broker clients KCS.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments