AMQP
Available as of Camel X.X
The amqp: component supports the AMQP 1.0 protocol using the JMS Client API of the Qpid project. In case you want to use AMQP with RabbitMQ 0.9 (in particular RabbitMQ) you might also be interested in the Camel RabbitMQ component. Please keep in mind that prior to the Camel 2.17.0 AMQP component supported AMQP 0.9 and above, however since Camel 2.17.0 it supports only AMQP 1.0.
Maven users will need to add the following dependency to their pom.xml
for this component:
...
To have using topics working with camel-amqp
you need to configure the component to use "topic://
" as topic prefix, as shown below:
Code Block |
---|
<bean id="amqp" class="org.apache.camel.component.jmsamqp.JmsComponentAmqpComponent"> <property name="connectionFactory"> <bean class="org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl" factory-method="createFromURL"> <constructor-arg index="0" type="java.lang.String" value="amqp://localhost:5672" /> <property name="topicPrefix" value="topic://" /> <!-- only necessary when connecting to ActiveMQ over AMQP 1.0 --> </bean> </property> </bean> |
Starting from the Camel 2.16.1 you can also use the AMQPComponent#amqp10Component(String connectionURI)
factory method to return the AMQP 1.0 component with the pre-configured topic prefix:
Code Block | ||||
---|---|---|---|---|
| ||||
AMQPComponent amqp = AMQPComponent.amqp10Component("amqp://guest:guest@localhost:5672"); |
Keep in mind that starting from the Camel 2.17 the AMQPComponent#amqp10Component(String connectionURI)
factory method has been deprecated on the behalf of the AMQPComponent#amqpComponent(String connectionURI)
:
Code Block | ||||
---|---|---|---|---|
| ||||
AMQPComponent amqp = AMQPComponent.amqpComponent("amqp://localhost:5672"); |
Include Page | ||||
---|---|---|---|---|
|