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 2015/03/18 08:19:47 UTC

svn commit: r944183 - in /websites/production/camel/content: cache/main.pageCache paho.html

Author: buildbot
Date: Wed Mar 18 07:19:46 2015
New Revision: 944183

Log:
Production update by buildbot for camel

Modified:
    websites/production/camel/content/cache/main.pageCache
    websites/production/camel/content/paho.html

Modified: websites/production/camel/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.

Modified: websites/production/camel/content/paho.html
==============================================================================
--- websites/production/camel/content/paho.html (original)
+++ websites/production/camel/content/paho.html Wed Mar 18 07:19:46 2015
@@ -91,7 +91,10 @@
                             <p>Available as of Camel 2.16<span style="line-height: 1.4285715;">&#160;</span></p>
                     </div>
     </div>
-<p>Paho component provides connector for the MQTT messaging protocol using the <a shape="rect" class="external-link" href="https://eclipse.org/paho/" rel="nofollow">Paho</a> library.</p><h3 id="Paho-Addingthecomponenttotheproject">Adding the component to the project</h3><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">
+<p>Paho component provides connector for the MQTT messaging protocol using the <a shape="rect" class="external-link" href="https://eclipse.org/paho/" rel="nofollow">Eclipse Paho</a> library. Paho is one of the most popular MQTT libraries, so if you would like to integrate it with your Java project - Camel Paho connector is a way to go.</p><h3 id="Paho-URIformat"><span>URI format</span></h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[paho:queueName[?options]
+]]></script>
+</div></div><p><span>You can append query options to the URI in the following format:&#160;<code>?option=value&amp;option=value&amp;...</code>&#160;.</span></p><h3 id="Paho-Addingthecomponenttotheproject">Adding the component to the project</h3><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="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[&lt;dependency&gt;
     &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
     &lt;artifactId&gt;camel-paho&lt;/artifactId&gt;
@@ -109,24 +112,21 @@
     &lt;/snapshots&gt;
   &lt;/repository&gt;
 &lt;/repositories&gt;]]></script>
-</div></div><h3 id="Paho-Defaultpayloadtype">Default payload type</h3><p>By default Camel Paho component operates on the binary payloads extracted out of (or put into) the MQTT message:</p><p>&#160;</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="Paho-Defaultpayloadtype"><span style="line-height: 1.5625;">Default payload type</span></h3><p><span style="line-height: 1.4285715;">&#160;</span></p><p>By default Camel Paho component operates on the binary payloads extracted out of (or put into) the MQTT message:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[// Receive payload
 byte[] payload = (byte[]) consumerTemplate.receiveBody(&quot;paho:topic&quot;);
  
 // Send payload
 byte[] payload = &quot;message&quot;.getBytes();
 producerTemplate.sendBody(&quot;paho:topic&quot;, payload);]]></script>
-</div></div><p>But of course Camel can perform the automatic data type conversions for you:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p><span style="line-height: 1.4285715;">&#160;</span></p><p>But of course Camel build-in&#160;<a shape="rect" href="type-converter.html">type conversion API</a> can perform the automatic data type transformations for you. In the example below Camel automatically converts binary payload into String (and&#160;conversely):</p><p><span style="line-height: 1.4285715;">&#160;</span></p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[// Receive payload
 String payload = consumerTemplate.receiveBody(&quot;paho:topic&quot;, String.class);
  
 // Send payload
 String payload = &quot;message&quot;;
 producerTemplate.sendBody(&quot;paho:topic&quot;, payload);]]></script>
-</div></div><h3 id="Paho-URIformat">URI format</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[paho:queueName[?options]
-]]></script>
-</div></div><p><span style="line-height: 1.4285715;">You can append query options to the URI in the following format: <code>?option=value&amp;option=value&amp;...</code> .</span></p><h3 id="Paho-URIOptions">URI Options</h3><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Option</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>clientId</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>camel-&lt;timestamp&gt;</code></td><td colspan="1" rowspan="1" class="confluenceTd">MQTT client identifier.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>brokerUrl</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>tcp://localhost:1883</code></p></td><td colspan="1" rowspan="1" cl
 ass="confluenceTd"><p>The URL of the MQTT broker.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>persistence</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>memory</code></td><td colspan="1" rowspan="1" class="confluenceTd">Client persistence to be used - <code>memory</code> or <code>file</code>.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>qos</code></td><td colspan="1" rowspan="1" class="confluenceTd">2</td><td colspan="1" rowspan="1" class="confluenceTd">Client quality of service level (<code>0</code>-<code>2</code>).</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>connectOptions</code></td><td colspan="1" rowspan="1" class="confluenceTd">none</td><td colspan="1" rowspan="1" class="confluenceTd">The reference to the <code><span style="line-height: 1.4285715;">org</span><span style="line-height: 1.4285715;">.eclipse.paho.client.mqttv3.</span><code style="line-height: 1.4285715;">MqttConnectOption
 s</code></code><span style="line-height: 1.4285715;"> instance located in the Camel registry. Referenced </span><code>MqttConnectOptions</code> instance <span style="line-height: 1.4285715;">will be used by the endpoint to initialize the connection. For example <code>connectOptions=#my</code><span><code>ConnectOptions</code></span> notation can be used to reference Spring bean named <code>my</code><span><code>ConnectOptions.</code></span></span></td></tr></tbody></table></div></div><h3 id="Paho-Headers">Headers</h3><p>The following headers are recognized by the Paho component:</p><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Header</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Java constant</p></th><th colspan="1" rowspan="1" class="confluenceTh">Endpoint type</th><th colspan="1" rowspan="1" class="confluenceTh">Value type</th><th colspan="1" rowspan="1" class="con
 fluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>PahoOriginalMessage</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code><span>PahoConstants.</span><span>HEADER_ORIGINAL_MESSAGE</span></code></td><td colspan="1" rowspan="1" class="confluenceTd">Consumer</td><td colspan="1" rowspan="1" class="confluenceTd"><code>org.eclipse.paho.client.mqttv3.MqttMessage</code></td><td colspan="1" rowspan="1" class="confluenceTd">The original Paho message instance received by the client.</td></tr></tbody></table></div></div><h3 id="Paho-Examples">Examples</h3><p>Read messages from the MQTT broker installed on the same host as the Camel router:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p><span style="line-height: 1.4285715;"><br clear="none"></span></p><h3 id="Paho-URIOptions">URI Options</h3><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Option</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>clientId</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>camel-&lt;timestamp&gt;</code></td><td colspan="1" rowspan="1" class="confluenceTd">MQTT client identifier.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>brokerUrl</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>tcp://localhost:1883</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The URL of the MQTT broker.</p></td></tr><tr><td colspan="1" rowspan="1" class=
 "confluenceTd"><code>persistence</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>memory</code></td><td colspan="1" rowspan="1" class="confluenceTd">Client persistence to be used - <code>memory</code> or <code>file</code>.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>qos</code></td><td colspan="1" rowspan="1" class="confluenceTd">2</td><td colspan="1" rowspan="1" class="confluenceTd">Client quality of service level (<code>0</code>-<code>2</code>).</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>connectOptions</code></td><td colspan="1" rowspan="1" class="confluenceTd">none</td><td colspan="1" rowspan="1" class="confluenceTd">The reference to the <code><span style="line-height: 1.4285715;">org</span><span style="line-height: 1.4285715;">.eclipse.paho.client.mqttv3.</span><code style="line-height: 1.4285715;">MqttConnectOptions</code></code><span style="line-height: 1.4285715;"> instance located in the Camel registry. Referen
 ced </span><code>MqttConnectOptions</code> instance <span style="line-height: 1.4285715;">will be used by the endpoint to initialize the connection. For example <code>connectOptions=#my</code><span><code>ConnectOptions</code></span> notation can be used to reference Spring bean named <code>my</code><span><code>ConnectOptions.</code></span></span></td></tr></tbody></table></div></div><h3 id="Paho-Headers">Headers</h3><p>The following headers are recognized by the Paho component:</p><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Header</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Java constant</p></th><th colspan="1" rowspan="1" class="confluenceTh">Endpoint type</th><th colspan="1" rowspan="1" class="confluenceTh">Value type</th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>Pah
 oOriginalMessage</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code><span>PahoConstants.</span><span>HEADER_ORIGINAL_MESSAGE</span></code></td><td colspan="1" rowspan="1" class="confluenceTd">Consumer</td><td colspan="1" rowspan="1" class="confluenceTd"><code>org.eclipse.paho.client.mqttv3.MqttMessage</code></td><td colspan="1" rowspan="1" class="confluenceTd">The original Paho message instance received by the client.</td></tr></tbody></table></div></div><h3 id="Paho-Examples">Examples</h3><p>Read messages from the MQTT broker installed on the same host as the Camel router:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[from(&quot;paho:some/queue&quot;).
   to(&quot;mock:test&quot;);]]></script>
 </div></div><p>Read messages from the remote MQTT broker:&#160;</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">