| <?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" |
| xmlns:ctx="http://www.springframework.org/schema/context" |
| xmlns:util="http://www.springframework.org/schema/util" |
| xmlns:jdbc="http://www.springframework.org/schema/jdbc" |
| xsi:schemaLocation=" |
| http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd |
| http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd |
| http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd |
| http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd |
| http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> |
| |
| <import resource="JdbcSpringDataSource.xml" /> |
| |
| <bean id="repoQuickRecovery" parent="repo1"> |
| <!-- scan 2 times per second --> |
| <property name="recoveryInterval" value="500"/> |
| <!-- enable recovery --> |
| <property name="useRecovery" value="true"/> |
| </bean> |
| |
| <!-- aggregate the messages using this strategy --> |
| <bean id="myAggregatorStrategy" class="org.apache.camel.processor.aggregate.jdbc.AbstractJdbcAggregationTestSupport$MyAggregationStrategy"/> |
| |
| <!-- and use this processor to simulate errors --> |
| <bean id="myFailProcessor" class="org.apache.camel.processor.aggregate.jdbc.JdbcSpringAggregateRecoverWithRedeliveryPolicyTest$MyFailProcessor"/> |
| |
| <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring" trace="true"> |
| <route> |
| <from uri="direct:start"/> |
| <!-- aggregate using our strategy and jdbc repo, and complete when we have 5 messages aggregated --> |
| <aggregate strategyRef="myAggregatorStrategy" aggregationRepositoryRef="repoQuickRecovery" completionSize="5"> |
| <!-- correlate by header with the key id --> |
| <correlationExpression><header>id</header></correlationExpression> |
| <!-- send aggregated messages out here --> |
| <to uri="mock:aggregated"/> |
| <!-- this processor will fail the first 2 attempts --> |
| <process ref="myFailProcessor"/> |
| <!-- at the 3rd attempt we should be able to send to this mock result endpoint --> |
| <to uri="mock:result"/> |
| </aggregate> |
| </route> |
| </camelContext> |
| |
| </beans> |