blob: f10874d80977b666f6f269617dd5788f8e991e26 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
">
<!-- START SNIPPET: e1 -->
<!-- a persistent aggregation repository using camel-hawtdb -->
<bean id="repo" class="org.apache.camel.component.hawtdb.HawtDBAggregationRepository">
<!-- store the repo in the hawtdb.dat file -->
<property name="persistentFileName" value="target/data/hawtdb.dat"/>
<!-- and use repo2 as the repository name -->
<property name="repositoryName" value="repo2"/>
</bean>
<!-- aggregate the messages using this strategy -->
<bean id="myAggregatorStrategy" class="org.apache.camel.component.hawtdb.HawtDBSpringAggregateTest$MyAggregationStrategy"/>
<!-- this is the camel routes -->
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="direct:start"/>
<!-- aggregate using our strategy and hawtdb repo, and complete when we have 5 messages aggregated -->
<aggregate strategyRef="myAggregatorStrategy" aggregationRepositoryRef="repo" completionSize="5">
<!-- correlate by header with the key id -->
<correlationExpression><header>id</header></correlationExpression>
<!-- send aggregated messages to the mock endpoint -->
<to uri="mock:aggregated"/>
</aggregate>
</route>
</camelContext>
<!-- END SNIPPET: e1 -->
</beans>