|
|
|
|
@@ -1,7 +1,9 @@
|
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
|
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:integration="http://www.springframework.org/schema/integration"
|
|
|
|
|
xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop"
|
|
|
|
|
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
|
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
|
|
|
|
xmlns:integration="http://www.springframework.org/schema/integration"
|
|
|
|
|
xmlns:context="http://www.springframework.org/schema/context"
|
|
|
|
|
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
|
|
|
|
|
xmlns:p="http://www.springframework.org/schema/p" 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-2.5.xsd
|
|
|
|
|
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
|
|
|
|
|
@@ -18,10 +20,16 @@
|
|
|
|
|
<integration:inbound-channel-adapter
|
|
|
|
|
ref="testCase" method="input" channel="requests">
|
|
|
|
|
<integration:poller max-messages-per-poll="1">
|
|
|
|
|
<integration:interval-trigger interval="10" />
|
|
|
|
|
<!--
|
|
|
|
|
TODO: the initial delay is a hack - it usually prevents the poller
|
|
|
|
|
from picking up data in the list before it is cleared, but one day
|
|
|
|
|
100ms will not be enough... (see INT-536)
|
|
|
|
|
-->
|
|
|
|
|
<integration:interval-trigger interval="10"
|
|
|
|
|
initial-delay="100" />
|
|
|
|
|
<integration:advice-chain>
|
|
|
|
|
<ref bean="txAdvice"/>
|
|
|
|
|
<ref bean="repeatAdvice"/>
|
|
|
|
|
<ref bean="txAdvice" />
|
|
|
|
|
<ref bean="repeatAdvice" />
|
|
|
|
|
</integration:advice-chain>
|
|
|
|
|
</integration:poller>
|
|
|
|
|
</integration:inbound-channel-adapter>
|
|
|
|
|
@@ -39,32 +47,44 @@
|
|
|
|
|
<tx:method name="*" />
|
|
|
|
|
</tx:attributes>
|
|
|
|
|
</tx:advice>
|
|
|
|
|
<bean id="repeatAdvice" class="org.springframework.batch.repeat.interceptor.RepeatOperationsInterceptor">
|
|
|
|
|
|
|
|
|
|
<bean id="repeatAdvice"
|
|
|
|
|
class="org.springframework.batch.repeat.interceptor.RepeatOperationsInterceptor">
|
|
|
|
|
<property name="repeatOperations">
|
|
|
|
|
<bean class="org.springframework.batch.repeat.support.RepeatTemplate">
|
|
|
|
|
<property name="completionPolicy">
|
|
|
|
|
<bean class="org.springframework.batch.repeat.policy.SimpleCompletionPolicy">
|
|
|
|
|
<bean
|
|
|
|
|
class="org.springframework.batch.repeat.policy.SimpleCompletionPolicy">
|
|
|
|
|
<property name="chunkSize" value="2" />
|
|
|
|
|
</bean>
|
|
|
|
|
</property>
|
|
|
|
|
</bean>
|
|
|
|
|
</property>
|
|
|
|
|
</bean>
|
|
|
|
|
<bean id="service" class="org.springframework.batch.integration.retry.SimpleService" />
|
|
|
|
|
<bean id="recoverer" class="org.springframework.batch.integration.retry.SimpleRecoverer" />
|
|
|
|
|
<bean id="retryAdvice" class="org.springframework.batch.retry.interceptor.StatefulRetryOperationsInterceptor">
|
|
|
|
|
|
|
|
|
|
<bean id="service"
|
|
|
|
|
class="org.springframework.batch.integration.retry.SimpleService" />
|
|
|
|
|
|
|
|
|
|
<bean id="recoverer"
|
|
|
|
|
class="org.springframework.batch.integration.retry.SimpleRecoverer" />
|
|
|
|
|
|
|
|
|
|
<bean id="retryAdvice"
|
|
|
|
|
class="org.springframework.batch.retry.interceptor.StatefulRetryOperationsInterceptor">
|
|
|
|
|
<property name="retryOperations">
|
|
|
|
|
<bean class="org.springframework.batch.retry.support.RetryTemplate">
|
|
|
|
|
<property name="retryPolicy">
|
|
|
|
|
<bean class="org.springframework.batch.retry.policy.SimpleRetryPolicy">
|
|
|
|
|
<property name="maxAttempts" value="2"/>
|
|
|
|
|
<property name="maxAttempts" value="2" />
|
|
|
|
|
</bean>
|
|
|
|
|
</property>
|
|
|
|
|
</bean>
|
|
|
|
|
</property>
|
|
|
|
|
<property name="recoverer" ref="recoverer" />
|
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
|
|
<aop:config proxy-target-class="true">
|
|
|
|
|
<aop:advisor advice-ref="retryAdvice" pointcut="execution(* org.springframework.batch.integration.retry.Service+.process(..))" />
|
|
|
|
|
<aop:advisor advice-ref="retryAdvice"
|
|
|
|
|
pointcut="execution(* org.springframework.batch.integration.retry.Service+.process(..))" />
|
|
|
|
|
</aop:config>
|
|
|
|
|
|
|
|
|
|
</beans>
|