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 2012/09/02 14:17:38 UTC

svn commit: r830866 - in /websites/production/camel/content: cache/main.pageCache couchdb.html zeromq.html

Author: buildbot
Date: Sun Sep  2 12:17:38 2012
New Revision: 830866

Log:
Production update by buildbot for camel

Added:
    websites/production/camel/content/zeromq.html
Modified:
    websites/production/camel/content/cache/main.pageCache
    websites/production/camel/content/couchdb.html

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

Modified: websites/production/camel/content/couchdb.html
==============================================================================
--- websites/production/camel/content/couchdb.html (original)
+++ websites/production/camel/content/couchdb.html Sun Sep  2 12:17:38 2012
@@ -121,6 +121,12 @@ couchdb:http:<span class="code-comment">
 </div>
 </div>
 
+<p>Headers are set by the consumer once the message is received. The producer will also set the headers for downstream processors once the insert/update has taken place. Any headers set prior to the producer are ignored. That means for example, if you set CouchDbId as a header, it will not be used as the id for insertion, the id of the document will still be used.</p>
+
+<h3><a shape="rect" name="CouchDB-MessageBody"></a>Message Body</h3>
+
+<p>The component will use the message body as the document to be inserted. If the body is an instance of String, then it will be marshalled into a GSON object before insert. This means that the string must be valid JSON or the insert / update will fail. If the body is an instance of a com.google.gson.JsonElement then it will be inserted as is. Otherwise the producer will throw an exception of unsupported body type.</p>
+
 <h3><a shape="rect" name="CouchDB-Samples"></a>Samples</h3>
 
 <p>For example if you wish to consume all inserts, updates and deletes from a CouchDB instance running locally, on port 9999 then you could use the following:</p>

Added: websites/production/camel/content/zeromq.html
==============================================================================
--- websites/production/camel/content/zeromq.html (added)
+++ websites/production/camel/content/zeromq.html Sun Sep  2 12:17:38 2012
@@ -0,0 +1,251 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<html>
+<head>
+    <link href="http://camel.apache.org/styles/site.css" rel="stylesheet" type="text/css">
+    <link href="http://camel.apache.org/styles/type-settings.css" rel="stylesheet" type="text/css">
+    <script src="http://camel.apache.org/styles/prototype.js" type="text/javascript"></script>
+    <script src="http://camel.apache.org/styles/rico.js" type="text/javascript"></script>    
+    <script src="http://camel.apache.org/styles/site.js" type="text/javascript"></script>
+
+    <meta http-equiv="Content-type" content="text/html;charset=UTF-8">
+
+    <style type="text/css">
+      .maincontent { overflow:hidden; }
+    </style>
+    <!--[if IE]>
+    <style type="text/css">
+      .maincontent { width:100%; }
+    </style>
+    <![endif]-->
+
+    <title>
+    Apache Camel: ZeroMQ
+    </title>
+</head>
+<body>
+<div class="white_box">
+<div class="header">
+  <div class="header_l">
+    <div class="header_r">
+    </div>
+  </div>
+</div>
+<div class="content">
+  <div class="content_l">
+    <div class="content_r">
+      <div>
+          <!-- Banner -->
+<div id="banner-content">
+	<div id="asf_logo">
+	<div id="activemq_logo" style="height:108px; background:transparent url(banner.data/apache-camel-7.png) no-repeat scroll left top;">
+            <a shape="rect" style="float:left; width:310px;display:block;text-indent:-5000px;text-decoration:none;line-height:140px; margin-top:20px; margin-left:18px;" href="http://camel.apache.org/">Camel</a>
+            <a shape="rect" style="float:right; width:180px;display:block;text-indent:-5000px;text-decoration:none;line-height:80px; margin-top:45px; margin-right:10px;" href="http://www.apache.org">Apache</a>
+	</div>
+        </div>
+</div>
+          <!-- Banner -->
+        <div class="top_red_bar">
+          <div id="site-breadcrumbs">
+                <!-- Breadcrumbs -->
+<a href="index.html">Apache Camel</a>&nbsp;&gt;&nbsp;<a href="documentation.html">Documentation</a>&nbsp;&gt;&nbsp;<a href="components.html">Components</a>&nbsp;&gt;&nbsp;<a href="zeromq.html">ZeroMQ</a>
+          </div>
+          <!-- Quicklinks -->
+<div id="site-quicklinks"><p><a shape="rect" href="download.html" title="Download">Download</a> | <a shape="rect" href="javadoc.html" title="JavaDoc">JavaDoc</a> | <a shape="rect" href="source.html" title="Source">Source</a> | <a shape="rect" href="discussion-forums.html" title="Discussion Forums">Forums</a> | <a shape="rect" href="support.html" title="Support">Support</a></p></div>
+          <!-- Quicklinks -->
+        </div>
+
+	<table border="0">
+	<tbody>
+        <tr>
+        <td valign="top" width="100%">
+<div class="wiki-content maincontent"><h2><a shape="rect" name="ZeroMQ-CamelZeroMQComponent"></a>Camel ZeroMQ Component</h2>
+
+<p><b>Not Yet Available</b></p>
+
+<p>The <b>zeromq:</b> component allows you to consumer or produce messages using <a shape="rect" class="external-link" href="http://zeromq.org/" rel="nofollow">ZeroMQ</a>. Zeromq requires a bit of work to get setup, especially on windows. Refer to <a shape="rect" class="external-link" href="http://www.zeromq.org/intro:get-the-software" rel="nofollow">the documentation</a>. Note: This component works with the stable 2.2 branch and not the pre-release 3.2.</p>
+
+<p>This component uses Akka for it's Zeromq "driver" but does not use Scala Actors. This means the component does not require the JZMQ libraries to be built and present, just the native ZeroMQ library that is installed when you build ZeroMQ on your system. There is some discussion as to the speed of the Akka driver, and so it is possible to switch to using the JZMQ driver if you wish. Simply remove the Akka Zeromq dependancy and replace it with the JZMQ jar and ensure the zmq.lib is present on your system. For more information see <a shape="rect" class="external-link" href="http://www.zeromq.org/bindings:java" rel="nofollow">here</a>.</p>
+
+<p>Maven users will need to add the following dependency to their <tt>pom.xml</tt> for this component:</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-xml">
+<span class="code-tag">&lt;dependency&gt;</span>
+    <span class="code-tag">&lt;groupId&gt;</span>org.apache.camel<span class="code-tag">&lt;/groupId&gt;</span>
+    <span class="code-tag">&lt;artifactId&gt;</span>camel-zeromq<span class="code-tag">&lt;/artifactId&gt;</span>
+    <span class="code-tag">&lt;version&gt;</span>x.x.x<span class="code-tag">&lt;/version&gt;</span>
+    <span class="code-tag"><span class="code-comment">&lt;!-- use the same version as your Camel core version --&gt;</span></span>
+<span class="code-tag">&lt;/dependency&gt;</span>
+</pre>
+</div></div>
+
+<h3><a shape="rect" name="ZeroMQ-URIformat"></a>URI format</h3>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+zeromq:(tcp|ipc):<span class="code-comment">//hostname:port[?options...]</span>
+</pre>
+</div></div>
+
+<p>Where <b>hostname</b> is the hostname or ip where the server will run. </p>
+
+<h3><a shape="rect" name="ZeroMQ-Options"></a>Options</h3>
+<div class="confluenceTableSmall"><div class="table-wrap">
+<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"> Property </th><th colspan="1" rowspan="1" class="confluenceTh"> Default </th><th colspan="1" rowspan="1" class="confluenceTh"> Description </th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>socketType</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>none</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Choose from PULL, SUBSCRIBE for consumers, or PUSH, PUBLISH for producers </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>asyncConsumer</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>true</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Sets the consumer to be async. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>topics</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Applicable for subscribers and
  publishers only. Determines which topics to subscribe or publish to. If not specified then the subscriber will subscribe to all messages. If not specified by a publisher then no topic will be prefixed to the message. Specify multiple topics by a comma separated list </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>messageIdEnabled</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> If enabled then camel-zeromq will add a unique UUID to each message as it is received </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>messageConvertor</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>DefaultMessageConvertor</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> The message convertor that is used to turn an exchange into a byte array for dispatch through zeromq. See later section. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <t
 t>highWaterMark</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>-1</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> By default, zeromq will keep messages in an in-memory buffer while waiting for clients to receive. The high water mark is the max number of messages to hold before throwing an exception. -1 sets to the zeromq default, 0 disables, and any positive value sets to that value. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>linger</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>-1</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> By default, zeromq will wait for sending messages to be received before shutting down. Linger is the number of seconds to wait before force closing the socket. -1 sets to the zeromq default, 0 disables, and any positive value sets to that value. </td></tr></tbody></table>
+</div>
+</div>
+
+<h3><a shape="rect" name="ZeroMQ-Headers"></a>Headers</h3>
+
+<p>The follwing headers are set on exchanges during message transport.</p>
+
+<div class="table-wrap">
+<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"> Header Name </th><th colspan="1" rowspan="1" class="confluenceTh"> Endpoint Type </th><th colspan="1" rowspan="1" class="confluenceTh"> Description </th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> ZeroMQMessageId </td><td colspan="1" rowspan="1" class="confluenceTd"> Consumer </td><td colspan="1" rowspan="1" class="confluenceTd"> A type 4 UUID that is added to received messages </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> ZeroMQTimestamp </td><td colspan="1" rowspan="1" class="confluenceTd"> Both </td><td colspan="1" rowspan="1" class="confluenceTd"> The timestamp when the message was received </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> ZeroMQSource </td><td colspan="1" rowspan="1" class="confluenceTd"> Both </td><td colspan="1" rowspan="1" class="confluenceTd"> The socket address where the message was received from or pushed to </
 td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> ZeroMQSocketType </td><td colspan="1" rowspan="1" class="confluenceTd"> Both </td><td colspan="1" rowspan="1" class="confluenceTd"> The type of zeromq that the message was received from or pushed to </td></tr></tbody></table>
+</div>
+
+
+<h3><a shape="rect" name="ZeroMQ-MessageConversion"></a>Message Conversion</h3>
+
+<p>ZeroMQ sends its messages as a byte stream and so incoming messages have the body set as a byte[] array. When sending to a producer, the messageConvertor is invoked, and passed the Exchange. The DefaultMessageConvertor will return the body as is, if it is a byte array, otherwise it will call toString().getBytes(). You can provide custom conversion strategies by specifying a class to the messageConvertor option on the endpoint.</p>
+
+<h3><a shape="rect" name="ZeroMQ-Samples"></a>Samples</h3>
+
+<p>To receive all messages from a publisher, and then print those to a logger:</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+from(<span class="code-quote">"zeromq:tcp:<span class="code-comment">//127.0.0.1:5555"</span>).process(someLoggingProcessor);</span>
+</pre>
+</div></div>
+
+<p>To broadcast a message every second on three topics:</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+        from(<span class="code-quote">"timer:<span class="code-comment">//foo?fixedRate=<span class="code-keyword">true</span>&amp;period=10"</span>).process(<span class="code-keyword">new</span> Processor() {
+</span>        
+        List&lt;<span class="code-object">String</span>&gt; asList = Arrays.asList(<span class="code-quote">"coldplay"</span>, <span class="code-quote">"keane"</span>, <span class="code-quote">"jethro tull"</span>, <span class="code-quote">"jack bruce"</span>, <span class="code-quote">"elton john"</span>, <span class="code-quote">"kate bush"</span>);
+
+			@Override
+			<span class="code-keyword">public</span> void process(Exchange exchange) <span class="code-keyword">throws</span> Exception {
+				Collections.shuffle(asList);
+				exchange.getIn().setBody(asList.get(0));
+			}
+		}).to(<span class="code-quote">"zeromq:tcp:<span class="code-comment">//127.0.0.1:5556?socketType=PUBLISH&amp;topics=bands,musicians,singers"</span>);</span>
+</pre>
+</div></div></div>
+        </td>
+        <td valign="top">
+          <div class="navigation">
+            <div class="navigation_top">
+                <!-- NavigationBar -->
+<div class="navigation_bottom" id="navigation_bottom"><h3><a shape="rect" name="Navigation-Overview"></a><a shape="rect" href="overview.html" title="Overview">Overview</a></h3>
+
+<ul class="alternate" type="square"><li><a shape="rect" href="index.html" title="Index">Home</a></li><li><a shape="rect" href="download.html" title="Download">Download</a></li><li><a shape="rect" href="getting-started.html" title="Getting Started">Getting Started</a></li><li><a shape="rect" href="faq.html" title="FAQ">FAQ</a></li></ul>
+
+
+<h3><a shape="rect" name="Navigation-Documentation"></a><a shape="rect" href="documentation.html" title="Documentation">Documentation</a></h3>
+
+<ul class="alternate" type="square"><li><a shape="rect" href="user-guide.html" title="User Guide">User Guide</a></li><li><a shape="rect" href="manual.html" title="Manual">Manual</a></li><li><a shape="rect" href="books.html" title="Books">Books</a></li><li><a shape="rect" href="tutorials.html" title="Tutorials">Tutorials</a></li><li><a shape="rect" href="examples.html" title="Examples">Examples</a></li><li><a shape="rect" href="cookbook.html" title="Cookbook">Cookbook</a></li><li><a shape="rect" href="enterprise-integration-patterns.html" title="Enterprise Integration Patterns">Enterprise Integration Patterns</a></li><li><a shape="rect" href="architecture.html" title="Architecture">Architecture</a></li><li><a shape="rect" href="components.html" title="Components">Components</a></li><li><a shape="rect" href="data-format.html" title="Data Format">Data Format</a></li><li><a shape="rect" href="languages.html" title="Languages">Languages</a></li><li><a shape="rect" href="security.
 html" title="Security">Security</a></li></ul>
+
+
+<h3><a shape="rect" name="Navigation-Search"></a>Search</h3>
+
+
+<form enctype="application/x-www-form-urlencoded" method="get" id="cse-search-box" action="http://www.google.com/cse">
+  <div>
+    <input type="hidden" name="cx" value="007878419884033443453:m5nhvy4hmyq">
+    <input type="hidden" name="ie" value="UTF-8">
+    <input type="text" name="q" size="21">
+    <input type="submit" name="sa" value="Search">
+  </div>
+</form>
+<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&amp;lang=en"></script>
+
+
+<h3><a shape="rect" name="Navigation-Community"></a><a shape="rect" href="community.html" title="Community">Community</a></h3>
+
+<ul class="alternate" type="square"><li><a shape="rect" href="support.html" title="Support">Support</a></li><li><a shape="rect" href="contributing.html" title="Contributing">Contributing</a></li><li><a shape="rect" href="discussion-forums.html" title="Discussion Forums">Discussion Forums</a></li><li><a shape="rect" href="mailing-lists.html" title="Mailing Lists">Mailing Lists</a></li><li><a shape="rect" href="user-stories.html" title="User Stories">User Stories</a></li><li><a shape="rect" href="news.html" title="News">News</a></li><li><a shape="rect" href="articles.html" title="Articles">Articles</a></li><li><a shape="rect" href="site.html" title="Site">Site</a></li><li><a shape="rect" href="team.html" title="Team">Team</a></li><li><a shape="rect" class="external-link" href="http://camel-extra.googlecode.com/" rel="nofollow">Camel Extra</a></li></ul>
+
+
+<h3><a shape="rect" name="Navigation-Developers"></a><a shape="rect" href="developers.html" title="Developers">Developers</a></h3>
+
+<ul class="alternate" type="square"><li><a shape="rect" href="developers.html" title="Developers">Developer Guide</a></li><li><a shape="rect" href="source.html" title="Source">Source</a></li><li><a shape="rect" href="building.html" title="Building">Building</a></li><li><a shape="rect" href="javadoc.html" title="JavaDoc">JavaDoc</a></li><li><a shape="rect" href="irc-room.html" title="IRC Room">IRC Room</a></li></ul>
+
+
+<h3><a shape="rect" name="Navigation-ApacheSoftwareFoundation"></a>Apache Software Foundation</h3>
+
+<ul class="alternate" type="square"><li><a shape="rect" class="external-link" href="http://www.apache.org/licenses/">License</a></li><li><a shape="rect" class="external-link" href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li><li><a shape="rect" class="external-link" href="http://www.apache.org/foundation/thanks.html">Thanks</a></li><li><a shape="rect" class="external-link" href="http://www.apache.org/security/">Security</a></li></ul>
+</div>
+                <!-- NavigationBar -->
+            </div>
+          </div>
+        </td>
+        </tr>
+	</tbody>
+        </table>
+
+
+        <div class="bottom_red_bar"></div>
+      </div>
+    </div>
+  </div>
+</div>
+<div class="black_box">
+<div class="footer">
+  <div class="footer_l">
+    <div class="footer_r">
+      <div>
+        <a href="$base/privacy-policy.html">Privacy Policy</a> -
+        (<a href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=30149633">edit page</a>)
+   	 (<a href="https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=30149633&amp;showComments=true&amp;showCommentArea=true#addcomment">add comment</a>)
+      </div>
+    </div>
+  </div>
+</div>
+</div>
+</div>
+<div class="design_attribution">
+&copy; 2004-2011 The Apache Software Foundation.
+<br>          
+Apache Camel, Camel, Apache, the Apache feather logo, and the Apache Camel project logo are trademarks of The Apache Software Foundation.  All other marks mentioned may be trademarks or registered trademarks of their respective owners.
+<br>
+<a href="http://hiramchirino.com">Graphic Design By Hiram</a>
+</div>
+
+<!-- Camel committers that would like access to the Analytics, send a note to private@camel.apache.org -->
+<script type="text/javascript">
+
+  var _gaq = _gaq || [];
+  _gaq.push(['_setAccount', 'UA-25976253-1']);
+  _gaq.push(['_trackPageview']);
+
+  (function() {
+    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+  })();
+
+</script>
+
+</body>
+</html>
+
+