Aggregate ExamplePage edited by Claus IbsenChanges (1)
Full ContentAggregate ExampleAvailable as of Camel 2.3 AboutThis example demonstrates the new overhauled Aggregator 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 HawtDB component. How to runYou simply run it using the following maven goal: mvn camel:run How it worksThe 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 ctrl + c to shutdown Camel. Then you should be able to start the example again and resume where you left. When you want to complete the aggregation you can enter STOP as input and Camel will show you the result, which is the sum of all the numbers entered. The persistent datastore is located in the data/hawtdb.dat file. Its automatic created the first time. ExampleFor example we start the example for the first time using mvn camel:run and then we enter the two numbers 5 and 7 before we shutdown using ctrl + c. The relevant console output: [pache.camel.spring.Main.main()] DefaultCamelContext INFO Apache Camel 2.3-SNAPSHOT (CamelContext:camel) started Enter a number to be added (use STOP to end, and ctrl c to shutdown Camel): 5 Enter a number to be added (use STOP to end, and ctrl c to shutdown Camel): 7 Enter a number to be added (use STOP to end, and ctrl c to shutdown Camel): ^C[ Thread-2] Main$HangupInterceptor INFO Received hang up - stopping the main instance. [ Thread-2] MainSupport INFO Apache Camel 2.3-SNAPSHOT stopping
Stop watching space
|
Change email notification preferences
View Online
|
View Changes
|
Add Comment
|
