You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by bu...@apache.org on 2016/06/17 09:24:07 UTC

svn commit: r990775 - /websites/production/camel/content/amqp.html

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[&lt;dependency&gt;
     &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
     &lt;artifactId&gt;camel-amqp&lt;/artifactId&gt;
@@ -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&#160;<code>camel-amqp</code>&#160;you need to configure the component to use&#160;<code>topic://</code>&#160;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[ &lt;bean id=&quot;amqp&quot; class=&quot;org.apache.camel.component.amqp.AmqpComponent&quot;&gt;
-        &lt;property name=&quot;connectionFactory&quot;&gt;
-          &lt;bean class=&quot;org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl&quot; factory-method=&quot;createFromURL&quot;&gt;
-            &lt;constructor-arg index=&quot;0&quot; type=&quot;java.lang.String&quot; value=&quot;amqp://localhost:5672&quot; /&gt;
-            &lt;property name=&quot;topicPrefix&quot; value=&quot;topic://&quot; /&gt;  &lt;!-- only necessary when connecting to ActiveMQ over AMQP 1.0 --&gt;
-          &lt;/bean&gt;
-        &lt;/property&gt;
- &lt;/bean&gt;]]></script>
-</div></div><p>Keep in mind that both&#160;&#160;<code>AMQPComponent#amqpComponent()</code>&#160;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[     &lt;bean id=&quot;jmsConnectionFactory&quot; class=&quot;org.apache.qpid.jms.JmsConnectionFactory&quot;&gt;
+        &lt;property name=&quot;remoteURI&quot; value=&quot;amqp://localhost:5672&quot; /&gt;
+        &lt;property name=&quot;username&quot; value=&quot;admin&quot;/&gt;
+        &lt;property name=&quot;password&quot; value=&quot;admin&quot;/&gt;
+    &lt;/bean&gt;
+
+	&lt;bean id=&quot;jmsCachingConnectionFactory&quot; class=&quot;org.springframework.jms.connection.CachingConnectionFactory&quot;&gt;
+    	&lt;property name=&quot;targetConnectionFactory&quot; ref=&quot;jmsConnectionFactory&quot; /&gt;
+	&lt;/bean&gt;
+
+	&lt;bean id=&quot;jmsConfig&quot; class=&quot;org.apache.camel.component.jms.JmsConfiguration&quot; &gt;
+  		&lt;property name=&quot;connectionFactory&quot; ref=&quot;jmsCachingConnectionFactory&quot; /&gt; 
+  		&lt;property name=&quot;cacheLevelName&quot; value=&quot;CACHE_CONSUMER&quot; /&gt;
+ 	&lt;/bean&gt;	
+
+	&lt;bean id=&quot;amqp&quot; class=&quot;org.apache.camel.component.amqp.AMQPComponent&quot;&gt;
+		&lt;property name=&quot;configuration&quot; ref=&quot;jmsConfig&quot; /&gt;
+	&lt;/bean&gt;	
+
+    &lt;camelContext xmlns=&quot;http://camel.apache.org/schema/blueprint&quot; id=&quot;simple&quot;&gt;
+        &lt;route&gt;
+            &lt;from uri=&quot;timer:simple?period=5000&quot;/&gt;
+            &lt;setBody&gt;
+                &lt;simple&gt;Hello World&lt;/simple&gt;
+            &lt;/setBody&gt;
+            &lt;to uri=&quot;amqp:test&quot;/&gt;
+        &lt;/route&gt;
+    &lt;/camelContext&gt;]]></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()&gt; repo-add camel
+karaf@root()&gt; 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>&#160;</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>&#160;</p></div>
         </td>
         <td valign="top">
           <div class="navigation">