user509755
user509755

Reputation: 2981

sftp channel outbound adapter with retry

I am using spring batch and spring integration where once my batch job is completed,it creates texts files and those needs to be uploaded to some ftp server. Sometimes we noticed that those connections drops and it needs to be retried. Is there anyway we can use spring retry project to try few sec later to see if it can upload those files. we want it to be configurable.

If so is there any example out there.

Thanks

Upvotes: 3

Views: 1421

Answers (1)

Artem Bilan
Artem Bilan

Reputation: 121227

Yes, Spring Integration provide retry component for you. It is called RequestHandlerRetryAdvice:

<int-sftp:outbound-channel-adapter>
    <int-sftp:request-handler-advice-chain>
        <bean class="org.springframework.integration.handler.advice.RequestHandlerRetryAdvice" />
    </int-sftp:request-handler-advice-chain>
</int-sftp:outbound-channel-adapter>

Please, find more info in the Reference Manual.

Consider to you use RequestHandlerCircuitBreakerAdvice also for your "connections drops" cases.

And here you are the sample.

Upvotes: 4

Related Questions