camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Camel > Aggregate Example
Date Tue, 02 Mar 2010 15:23:00 GMT
<html>
<head>
    <base href="http://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=CAMEL&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background-color: white" bgcolor="white">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
     <h2><a href="http://cwiki.apache.org/confluence/display/CAMEL/Aggregate+Example">Aggregate
Example</a></h2>
     <h4>Page <b>edited</b> by             <a href="http://cwiki.apache.org/confluence/display/~davsclaus">Claus
Ibsen</a>
    </h4>
     
          <br/>
     <div class="notificationGreySide">
         <h2><a name="AggregateExample-AggregateExample"></a>Aggregate Example</h2>
<p><b>Available as of Camel 2.3</b></p>

<h3><a name="AggregateExample-About"></a>About</h3>
<p>This example demonstrates the new overhauled <a href="/confluence/display/CAMEL/Aggregator2"
title="Aggregator2">Aggregator</a> EIP in Apache Camel 2.3. The example is focused
on the persistence support, which means the aggregated messages is stored in a persistent
file storage using the new <a href="/confluence/display/CAMEL/HawtDB" title="HawtDB">HawtDB</a>
component.</p>

<h3><a name="AggregateExample-Howtorun"></a>How to run</h3>
<p>You simply run it using the following maven goal: <tt>mvn camel:run</tt></p>

<h3><a name="AggregateExample-Howitworks"></a>How it works</h3>
<p>The example is an interactive example where it prompt on the console for you to enter
a number and press ENTER. The numbers you enter will then be aggregated and persisted. That
means you can at any time hit <tt>ctrl + c</tt> to shutdown Camel. Then you should
be able to start the example again and resume where you left.</p>

<p>When you want to <em>complete</em> the aggregation you can enter <tt>STOP</tt>
as input and Camel will show you the result, which is the sum of all the numbers entered.</p>

<p>The persistent datastore is located in the <tt>data/hawtdb.dat</tt> file.
Its automatic created the first time.</p>

<h3><a name="AggregateExample-UsingAggregator"></a>Using Aggregator</h3>
<p>The example is configured as follows in Spring XML.</p>

<p>TODO: e1</p>

<p>And it has a <tt>AggregationStrategy</tt> to sum the numbers which is
done in Java code as:</p>

<p>TODO: e1</p>

<h3><a name="AggregateExample-SeeAlso"></a>See Also</h3>
<ul class="alternate" type="square">
	<li><a href="/confluence/display/CAMEL/Examples" title="Examples">Examples</a></li>
	<li><a href="/confluence/display/CAMEL/Aggregator2" title="Aggregator2">Aggregator</a></li>
	<li><a href="/confluence/display/CAMEL/HawtDB" title="HawtDB">HawtDB</a></li>
</ul>

     </div>
     <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
       </div>

       <a href="http://cwiki.apache.org/confluence/display/CAMEL/Aggregate+Example">View
Online</a>
       |
       <a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=14811499&revisedVersion=2&originalVersion=1">View
Change</a>
              |
       <a href="http://cwiki.apache.org/confluence/display/CAMEL/Aggregate+Example?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message