Questions tagged [spring-retry]

Spring Retry provides an abstraction around retrying failed operations, with an emphasis on declarative control of the process and policy-based behaviour that is easy to extend and customize.

The Spring Retry project is refactored from Spring Batch's support for retrying operations as of Spring Batch 2.2.0. It is used in several Spring projects.

See also

469 questions
1
vote
1 answer

Want to send mail on each retry failure for REST post request

I am running a test application to make a http POST submission to 3rd party REST endpoint and implemented retry using advice. I have used basic requesthandleradvice with simpleretryplicy and backoffpolicy set as exponential.how to call a method that…
1
vote
1 answer

Spring Retry @Recover method for prototype-bean implementing Runnable not using field of prototype-bean

I've got a prototype bean implementing Runnable that has to retry its run-method and do something if the max retry cap is reached. Now I have the Problem that the recover method seems to be always invoked from the same spring bean not from the…
Nas3nmann
  • 480
  • 1
  • 6
  • 13
1
vote
1 answer

@TransactionalEventListener, @Transactional and @Retryable flow

When I publish CustomEvent in the end of @Transactional and @Retryable(value = StaleStateException.class) method foo(), how it is processed? If I get StaleStateException during commit after method execution, then @TransactionalEventListener(phase =…
1
vote
2 answers

Is there a way to Queue REST call with Spring?

I am working on a project that is making a REST call to another Service to save DATA on the DB. The Data is very important so we can't afford losing anything. If there is a problem in the network this message will be lost, which can't happen. I…
José Mendes
  • 950
  • 2
  • 14
  • 30
1
vote
1 answer

Fetch message details in Spring RecoveryCallback

I'm publishing messages into RabbitMQ and I would like to track the errors when RabbitMQ is down, for this I added one RetryTemplate with the recovery callback, but the recovery callback only provides this method getLastThrowable() and I'm not sure…
1
vote
1 answer

Spring Integration - Exceptions and retries

My setup: I have a message daemon using ActiveMQ which will consume JSON messages. The publisher of JSON messages adds type header with value, for ex, com.example.Foo which is the type of the json message. I use this to transform json to…
shravanp
  • 227
  • 2
  • 4
  • 12
1
vote
0 answers

JPA optimistic lock can't get the latest version

I am using the JPA's optimistic lock with spring data jpa and using spring retry for ConcurrencyFailureException, but something occurs that i can't understand. my test code just like below: @Repository public interface AccountRepo extends…
1
vote
1 answer

Configure spring boot retry for multiple API calls

I have a spring boot api application which has a POST endpoint,Lets call it /doSomething as method .when receive request for /doSomething endpoint i need to save that data on our application and then needs to make GET request for another api[A]…
Seth De
  • 417
  • 6
  • 18
1
vote
1 answer

Dynamically change the interceptor at runtime with Annotation based Spring Retry

I am using Annotation based Spring Retry. Below is my interface: public interface IRetriever { @Retryable(interceptor="RetryInterceptor") public abstract List retrieve(final LogData transactionLogData, final RetrieveRequestType…
1
vote
1 answer

How to get a file daily via SFTP using Spring Integration with Java config?

I need to get a file daily via SFTP. I would like to use Spring Integration with Java config. The file is generally available at a specific time each day. The application should try to get the file near that time each day. If the file is not…
James
  • 2,876
  • 18
  • 72
  • 116
1
vote
2 answers

Spring Batch - File to be read is not available

I have a Spring batch job with a first step that reads a file and writes to a database. If the file does not exist, I want the system to wait x minutes and then retry the step up to y number of attempts. How can I do this? Details The ItemReader is…
James
  • 2,876
  • 18
  • 72
  • 116
1
vote
1 answer

Is it possible to use 2 different retry beans for one service activator depending on an Exception thrown?

I would like to do a serious retry for the service-activator only in case of a ConnectionException, for other exceptions I would like not to use a retry or a very light retry. What configuration can I use? The essence of my configuration is…
Alex
  • 7,007
  • 18
  • 69
  • 114
1
vote
1 answer

Including Spring @Retryable without main or service class

I have an api that does not have main method in it, It is just set of classes for calling database procedures. None of the classes has Service annotation in them. I am including this api in another spring boot application. When I annotate any method…
sanvica
  • 99
  • 2
  • 12
1
vote
1 answer

Is there a way to prevent batch from double processing of the same chunk/item when an skip occurs?

In my particular scenario, I have to persist huge entities read from files to the database but my commit-interval is configured with value = 1. Also I'm not quite sure if the delegate processor in the CompositeItemProcessor used are idempotent. So…
guilhermerama
  • 750
  • 9
  • 21
1
vote
1 answer

Spring retry on Transacional method doesn't execute the same sequence of steps

I would like to retry transactional service method when JpaOptimisticLockingFailureException occurs When I annotate service method with @Retryable annotation @Retryable(value = JpaOptimisticLockingFailureException.class, maxAttempts = 3, backoff =…
Patrik Mihalčin
  • 3,341
  • 7
  • 33
  • 68