camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [CONF] Apache Camel > Aggregate Example
Date Tue, 02 Mar 2010 15:23:00 GMT
    <base href="">
            <link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=CAMEL&amp;forWysiwyg=true"
<body style="background-color: white" bgcolor="white">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
     <h2><a href="">Aggregate
     <h4>Page <b>edited</b> by             <a href="">Claus
     <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>

<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>

     <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href=""
class="grey">Change Notification Preferences</a>

       <a href="">View
       <a href="">View
       <a href=";showCommentArea=true#addcomment">Add

View raw message