<bean id="rabbitConnectionFactory" class="com.rabbitmq.client.ConnectionFactory">
<property name="host" value="localhost"/>
<property name="port" value="5672"/>
<property name="username" value="camel"/>
<property name="password" value="bugsbunny"/>
</bean>
And then refer to the connection factory in the endpoint uri as shown below:
<camelContext>
<route>
<from uri="direct:rabbitMQEx2"/>
<to uri="rabbitmq:ex2?connectionFactory=#rabbitConnectionFactory"/>
</route>
</camelContext>
<bean id="rabbitConnectionFactory" class="com.rabbitmq.client.ConnectionFactory">
<property name="host" value="localhost"/>
<property name="port" value="5672"/>
<property name="username" value="camel"/>
<property name="password" value="bugsbunny"/>
</bean>
And then refer to the connection factory in the endpoint uri as shown below:
<camelContext>
<route>
<from uri="direct:rabbitMQEx2"/>
<to uri="rabbitmq:ex2?connectionFactory=#rabbitConnectionFactory"/>
</route>
</camelContext>
Copy to ClipboardCopied!Toggle word wrapToggle overflow