1
votes

my goal is to let a spring-integration poller back off polling if several exceptions occur.

i have the following outbound-channel-adapter configured

    <int:outbound-channel-adapter id="adapter" ref="handler" 
        method="handle" channel="channel" >
        <int:poller max-messages-per-poll="50" fixed-delay="13"
             time-unit="SECONDS" task-executor="threadpool">
            <int:transactional synchronization-factory="mySyncFactory" 
                transaction-manager="simpleJdbcTransactionManager"
                timeout="30"/>
        </int:poller>   
    </int:outbound-channel-adapter>

now i want to add another advice (cuircuit breaker). for this i have to remove the int:transactional-tag an add an advice-chain instead. i can write that like this

    <int:outbound-channel-adapter id="adapter" ref="handler" 
        method="handle" channel="channel" >
        <int:poller max-messages-per-poll="50" fixed-delay="13"
             time-unit="SECONDS" task-executor="threadpool">
            <int:advice-chain>
                <tx:advice transaction-manager="simpleJdbcTransactionManager">
                    <tx:attributes>
                        <tx:method name="*" timeout="30000" />
                    </tx:attributes>
                </tx:advice>
                <int:ref bean="cuircuitBreaker"/>
            </int:advice-chain>
        </int:poller>   
    </int:outbound-channel-adapter>

i cannot find a possibility to declare a synchronization-factory for the tx-advice. any hints on how to realize this?

UPDATE i am using spring-integration version 3.0.4

1

1 Answers

1
votes

Looks like you have missed that <int:advice-chain> has the same synchronization-factory attribute and exactly for the same purpose.

And its description:

Setting of this attribute will only have an affect if a Transaction advice is present in the chain.