Author: buildbot
Date: Fri Jun 17 09:24:07 2016
New Revision: 990775
Log:
Production update by buildbot for camel
Modified:
websites/production/camel/content/amqp.html
Modified: websites/production/camel/content/amqp.html
==============================================================================
--- websites/production/camel/content/amqp.html (original)
+++ websites/production/camel/content/amqp.html Fri Jun 17 09:24:07 2016
@@ -85,7 +85,7 @@
<tbody>
<tr>
<td valign="top" width="100%">
-<div class="wiki-content maincontent"><h2 id="AMQP-AMQP">AMQP</h2><p>The
<strong style="line-height: 1.42857;">amqp:</strong> component supports the <a
shape="rect" class="external-link" href="http://www.amqp.org/"
style="line-height: 1.42857;" rel="nofollow">AMQP 1.0 protocol</a> using the
JMS Client API of the <a shape="rect" class="external-link"
href="http://qpid.apache.org/" style="line-height: 1.42857;">Qpid</a> project.
In case you want to use AMQP 0.9 (in particular RabbitMQ) you might also be
interested in the <a shape="rect" href="rabbitmq.html">Camel RabbitMQ</a>
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.</p><p>Maven users will need to add the following dependency to their
<code>pom.xml</code> for this component:</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<div class="wiki-content maincontent"><h2 id="AMQP-AMQP">AMQP</h2><p>The
<strong style="line-height: 1.42857;">amqp:</strong> component supports the <a
shape="rect" class="external-link" href="http://www.amqp.org/"
style="line-height: 1.42857;" rel="nofollow">AMQP 1.0 protocol</a> using the
JMS Client API of the <a shape="rect" class="external-link"
href="https://github.com/apache/qpid-jms/" rel="nofollow">Qpid</a> project. In
case you want to use AMQP 0.9 (in particular RabbitMQ) you might also be
interested in the <a shape="rect" href="rabbitmq.html">Camel RabbitMQ</a>
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.</p><p>Maven users will need to add the following dependency to their
<code>pom.xml</code> for this component:</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
<script class="brush: xml; gutter: false; theme: Default"
type="syntaxhighlighter"><![CDATA[<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-amqp</artifactId>
@@ -132,17 +132,40 @@ AMQPConnectionDetails amqpConnection() {
return AMQPConnectionDetails.discoverAMQP();
}
]]></script>
-</div></div><h3 id="AMQP-Usingtopics">Using topics</h3><p>To have using topics
working with <code>camel-amqp</code> you need to configure the
component to use <code>topic://</code> as topic prefix, as shown
below:</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default"
type="syntaxhighlighter"><![CDATA[ <bean id="amqp"
class="org.apache.camel.component.amqp.AmqpComponent">
- <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>]]></script>
-</div></div><p>Keep in mind that
both  <code>AMQPComponent#amqpComponent()</code> methods and
<code>AMQPConnectionDetails</code> pre-configure the component with the topic
prefix, so you don't have to configure it explicitly.</p><p></p><h3
id="AMQP-SeeAlso">See Also</h3>
-<ul><li><a shape="rect" href="configuring-camel.html">Configuring
Camel</a></li><li><a shape="rect"
href="component.html">Component</a></li><li><a shape="rect"
href="endpoint.html">Endpoint</a></li><li><a shape="rect"
href="getting-started.html">Getting Started</a></li></ul></div>
+</div></div><h3 id="AMQP-ConfiguringConnectionFactory">Configuring Connection
Factory</h3><p>Like with any other JMS-based component, usually it's important
to configure JMS connection factory. For example, you'd like to set your broker
url or set proper connection credentials. Additionally, you would always want
to set some kind of pooling (or caching) on the connection factory. An example
of how to do both of these tasks is shown below.</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default"
type="syntaxhighlighter"><![CDATA[ <bean
id="jmsConnectionFactory"
class="org.apache.qpid.jms.JmsConnectionFactory">
+ <property name="remoteURI"
value="amqp://localhost:5672" />
+ <property name="username" value="admin"/>
+ <property name="password" value="admin"/>
+ </bean>
+
+ <bean id="jmsCachingConnectionFactory"
class="org.springframework.jms.connection.CachingConnectionFactory">
+ <property name="targetConnectionFactory"
ref="jmsConnectionFactory" />
+ </bean>
+
+ <bean id="jmsConfig"
class="org.apache.camel.component.jms.JmsConfiguration" >
+ <property name="connectionFactory"
ref="jmsCachingConnectionFactory" />
+ <property name="cacheLevelName"
value="CACHE_CONSUMER" />
+ </bean>
+
+ <bean id="amqp"
class="org.apache.camel.component.amqp.AMQPComponent">
+ <property name="configuration"
ref="jmsConfig" />
+ </bean>
+
+ <camelContext
xmlns="http://camel.apache.org/schema/blueprint"
id="simple">
+ <route>
+ <from uri="timer:simple?period=5000"/>
+ <setBody>
+ <simple>Hello World</simple>
+ </setBody>
+ <to uri="amqp:test"/>
+ </route>
+ </camelContext>]]></script>
+</div></div><h3 id="AMQP-UsinginsideKaraf">Using inside Karaf</h3><p>If you
want to use <strong>amqp</strong> component inside the Karaf, there's already
defined feature that will install all necessary bundles for you. All you need
to do is</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default"
type="syntaxhighlighter"><![CDATA[karaf@root()> repo-add camel
+karaf@root()> feature:install camel-amqp]]></script>
+</div></div><p>and the environment would be set. Additionally you can add
<strong>camel-blueprint</strong> or <strong>camel-spring</strong> features if
you want to define your routes in those contexts.</p><p> </p><p></p><h3
id="AMQP-SeeAlso">See Also</h3>
+<ul><li><a shape="rect" href="configuring-camel.html">Configuring
Camel</a></li><li><a shape="rect"
href="component.html">Component</a></li><li><a shape="rect"
href="endpoint.html">Endpoint</a></li><li><a shape="rect"
href="getting-started.html">Getting Started</a></li></ul><p> </p></div>
</td>
<td valign="top">
<div class="navigation">