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 2013/03/06 11:18:52 UTC

svn commit: r853244 - in /websites/production/camel/content: cache/main.pageCache cep.html rx.html

Author: buildbot
Date: Wed Mar  6 10:18:52 2013
New Revision: 853244

Log:
Production update by buildbot for camel

Added:
    websites/production/camel/content/cep.html
Modified:
    websites/production/camel/content/cache/main.pageCache
    websites/production/camel/content/rx.html

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

Added: websites/production/camel/content/cep.html
==============================================================================
--- websites/production/camel/content/cep.html (added)
+++ websites/production/camel/content/cep.html Wed Mar  6 10:18:52 2013
@@ -0,0 +1,198 @@
+<!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: CEP
+    </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="architecture.html">Architecture</a>&nbsp;&gt;&nbsp;<a href="cep.html">CEP</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"><h1><a shape="rect" name="CEP-CamelCEP"></a>Camel CEP</h1>
+
+<p><a shape="rect" class="external-link" href="http://en.wikipedia.org/wiki/Complex_event_processing" rel="nofollow">Complex Event Processing</a> or <a shape="rect" class="external-link" href="http://en.wikipedia.org/wiki/Event_stream_processing" rel="nofollow">Event Stream Processing</a> are approaches of processing streams of events, usually from multiple sources. </p>
+
+<p>One approach to CEP with Camel is to use the <a shape="rect" href="esper.html" title="Esper">Esper endpoint</a> then use Esper's SQL-like DSL for working with event streams.</p>
+
+<p>Another approach to CEP with Camel is to use <a shape="rect" href="rx.html" title="RX">Camel RX</a> which provides a typesafe DSL in Java, Scala, Groovy, clojure for processing events in a natural collection-like way (while being high performance and asynchronous under the covers). <a shape="rect" href="rx.html" title="RX">Camel RX</a> uses the <a shape="rect" class="external-link" href="https://github.com/Netflix/RxJava/wiki" rel="nofollow">RxJava</a> <a shape="rect" class="external-link" href="http://netflix.github.com/RxJava/javadoc/" rel="nofollow">API</a> which is a JVM port of the <a shape="rect" class="external-link" href="https://rx.codeplex.com/" rel="nofollow">Reactive Extensions</a></p>
+
+<h2><a shape="rect" name="CEP-CEPwithCamelRXRX"></a>CEP with <a shape="rect" href="rx.html" title="RX">Camel RX</a></h2>
+
+<p><a shape="rect" href="rx.html" title="RX">Camel RX</a> provides various ways to get an <a shape="rect" class="external-link" href="http://netflix.github.com/RxJava/javadoc/rx/Observable.html" rel="nofollow">Observable&lt;T&gt;</a> which provides the typesafe DSL for processing events on a single stream.</p>
+
+<p>Once you have an <a shape="rect" class="external-link" href="http://netflix.github.com/RxJava/javadoc/rx/Observable.html" rel="nofollow">Observable&lt;T&gt;</a> you can then: </p>
+
+<ul><li><a shape="rect" class="external-link" href="https://github.com/Netflix/RxJava/wiki/Filtering-Operators" rel="nofollow">filter events</a></li><li><a shape="rect" class="external-link" href="https://github.com/Netflix/RxJava/wiki/Transformative-Operators" rel="nofollow">transform events</a></li><li><a shape="rect" class="external-link" href="https://github.com/Netflix/RxJava/wiki/Combinatorial-Operators" rel="nofollow">combine event streams</a></li><li><a shape="rect" class="external-link" href="https://github.com/Netflix/RxJava/wiki/Utility-Operators" rel="nofollow">other utility methods</a></li></ul>
+
+
+<p>Note that at the time of writing, some of the RX APIs have not yet been ported to <a shape="rect" class="external-link" href="https://github.com/Netflix/RxJava/wiki" rel="nofollow">RxJava</a> so that some of the core CEP functions are not yet implemented. e.g. these functions will really complete RxJava's CEP coverage:</p>
+
+<ul><li><a shape="rect" class="external-link" href="https://github.com/Netflix/RxJava/issues/102" rel="nofollow">window()</a> provides time windows over events</li><li><a shape="rect" class="external-link" href="https://github.com/Netflix/RxJava/issues/51" rel="nofollow">groupBy()</a></li><li><a shape="rect" class="external-link" href="https://github.com/Netflix/RxJava/issues/56" rel="nofollow">join()</a></li></ul>
+
+
+<p>So until RxJava hits 0.7 milestone there is <a shape="rect" class="external-link" href="https://github.com/Netflix/RxJava/wiki/Combinatorial-Operators" rel="nofollow">limited support for combining streams</a>; but that should hopefully be fixed soon. I'm sure the RxJava folks would welcome contributions on those issues <img align="middle" class="emoticon" src="https://cwiki.apache.org/confluence/images/icons/emoticons/smile.gif" height="20" width="20" alt="" border="0"> </p></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="architecture.html" title="Architecture">Architecture</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="dsl.html" title="DSL">DSL</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="Lang
 uages">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=30756499">edit page</a>)
+   	 (<a href="https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=30756499&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>
+
+

Modified: websites/production/camel/content/rx.html
==============================================================================
--- websites/production/camel/content/rx.html (original)
+++ websites/production/camel/content/rx.html Wed Mar  6 10:18:52 2013
@@ -148,7 +148,68 @@ ReactiveCamel rx = <span class="code-key
 <span class="code-comment">// lets send the events to a message queue
 </span>rx.sendTo(observable, <span class="code-quote">"activemq:MyQueue"</span>);
 </pre>
-</div></div> </div>
+</div></div> 
+
+<h2><a shape="rect" name="RX-EmbeddingsomeRxJavaprocessinginsideaCamelroute"></a>Embedding some RxJava processing inside a Camel route</h2>
+
+<p>Sometimes you may wish to use a Camel route to consume messages, perform content based routing, transformation, deal with data format marshalling and so forth and then within the route invoke some typesafe RxJava event processing.</p>
+
+<p>One approach is to just send messages from inside the Camel route to an endpoint; then use the <b>toObservable()</b> method to bind the endpoint to an Observable&lt;T&gt;.</p>
+
+<p>However if you prefer to embed the RxJava processing of messages inside your route there are 2 helper classes which can be used to wrap up the RxJava processing as a Camel Processor that can be easily embed into a Camel route.</p>
+
+<p>You can use the <b>ObservableMessage</b> or <b>ObservableBody</b> classes which both have an abstract <b>configure()</b> method like RouteBuilder. In the configure method you can then process the Observable&lt;T&gt; for the Camel Message or the message body.</p>
+
+<p>e.g. </p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+    <span class="code-keyword">public</span> class MyObservableBody <span class="code-keyword">extends</span> ObservableBody&lt;<span class="code-object">String</span>&gt; {
+        <span class="code-keyword">public</span> MyObservableBody() {
+            <span class="code-keyword">super</span>(<span class="code-object">String</span>.class);
+        }
+
+        <span class="code-keyword">protected</span> void configure(Observable&lt;<span class="code-object">String</span>&gt; observable) {
+            <span class="code-comment">// lets process the messages using the RX API
+</span>            observable.map(<span class="code-keyword">new</span> Func1&lt;<span class="code-object">String</span>, <span class="code-object">String</span>&gt;() {
+                <span class="code-keyword">public</span> <span class="code-object">String</span> call(<span class="code-object">String</span> body) {
+                    <span class="code-keyword">return</span> <span class="code-quote">"Hello "</span> + body;
+                }
+            }).subscribe(<span class="code-keyword">new</span> Action1&lt;<span class="code-object">String</span>&gt;() {
+                <span class="code-keyword">public</span> void call(<span class="code-object">String</span> body) {
+                    template.sendBody(resultEndpoint, body);
+                }
+            });
+        }
+    }
+    ...
+    <span class="code-comment">// now lets use <span class="code-keyword">this</span> inside a route...
+</span>    from(<span class="code-quote">"seda:foo"</span>).process(<span class="code-keyword">new</span> MyObservableBody());
+</pre>
+</div></div>
+
+<p>Another approach, if you are consuming directly from Camel using the <a shape="rect" href="bean-integration.html" title="Bean Integration">Bean Integration</a> is to just use the RxJava Subject directly:</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+<span class="code-keyword">import</span> rx.subjects.Subject;
+
+<span class="code-keyword">public</span> class MyThing {
+    <span class="code-keyword">private</span> <span class="code-keyword">final</span> Subject&lt;<span class="code-object">String</span>&gt; observable = Subject.create();
+  
+    <span class="code-keyword">public</span> MyThing() {
+         <span class="code-comment">// now process the observable somehow....
+</span>    }
+
+    @Consume(uri=<span class="code-quote">"activemq:myqueue"</span>)
+    <span class="code-keyword">public</span> void onMessageBody(<span class="code-object">String</span> body) {
+      subject.onNext(body);
+    }
+}
+</pre>
+</div></div>
+
+<p>Though using the <b>toObservable</b> on <b>ReactiveCamel</b> is maybe a little simpler.</p></div>
         </td>
         <td valign="top">
           <div class="navigation">