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
0 answers

Spring Batch RetryTemplate unexpected Retry

if i define a skip-limit in my chunk then a retrytemplate is created through FaultTolerantStepBuilder. Actually i do not want to use this RetryTemplate. org.springframework.batch.core.configuration.xml.StepParserStepFactoryBean#isFaultTolerant in…
whoami
  • 31
  • 4
1
vote
1 answer

What happened to RetryOperationsInterceptor? (spring-batch)

For retry functions, I want to use org.springframework.batch.retry.interceptor.RetryOperationsInterceptor. I can find it in spring-batch 2.1.X, but not in spring-batch 2.2.X. Was it deleted? Did it have a problem? If it was deleted and there is a…
Minsu
  • 141
  • 8
1
vote
1 answer

@Retryable with JPA create problems

Following this post I'm trying to implement the save() method of my Invoice bean using @Retryable in order to make my application more solid. I'm using Spring JPA + Hibernate. I've an inteface for my service: @RemoteDestination @DataEnabled …
drenda
  • 5,846
  • 11
  • 68
  • 141
1
vote
2 answers

Why Spring @Retryable does not provide retry?

I just setup the simplest Spring application with the @Retryable annotation. @Service public class MyRestService { @Autowired private RestTemplate restTemplate; @Retryable(Exception.class) public void runRest() { …
Alex
  • 7,007
  • 18
  • 69
  • 114
1
vote
1 answer

Any way to invoke a RecoveryCallback in a RabbitTemplate send operation?

I'm currently working with Spring AMQP version 1.3.6.RELEASE and Spring Retry 1.1.2.RELEASE. According to the Spring AMQP documentation section 3.3.1 one can add retry capabilities by passing in a RetryTemplate. Are there any existing capabilities…
Centinul
  • 874
  • 3
  • 10
  • 18
1
vote
1 answer

Add Batch capabilities to Integration flow

I currently have a Spring Integration flow that works fine (see link for diagram). I would like to add Batch on top of my current configuration to allow for retry with exponential back-off, circuit breaker pattern, and persisting jobs to the…
1
vote
3 answers

Ensure single instance of a spring managed bean

I have created a spring aspect to handle Retry mechanism. I have also created a Retry annotation. Following is the code for Retry annotation and an aspect which processes this…
Vivek Kothari
  • 462
  • 6
  • 20
0
votes
1 answer

SpringBoot RetryListener.onError() invoked without being configured at @Retryable

I am using @Retryable at various service methods. Some of them need some action to be done before the retry happens. I use a RetryListener implementation to achieve this. Well, that ended somehow weird. the listener's onError() is invoked though…
00schmidt
  • 1
  • 1
0
votes
2 answers

Spring Retry is not retrying based on exclude keyword

I am using Spring Retry. Earlier, I used @Retryable(value= Exception.class) & it worked correctly with retryAdvice(). The code correctly retried after getting any kind of exception. Recently, we have a requirement to not retry when…
lavin249
  • 25
  • 6
0
votes
1 answer

Spring RetryTemplate with logging not showing in unit tests

I have a service that uses SLF4J and Spring's RetryTemplate: retryTemplate.execute( retryContext -> { // Try to do something... return null; }, retryContext -> { Throwable t =…
KJ0797
  • 187
  • 1
  • 2
  • 14
0
votes
0 answers

How to use @Retryable with @Transactional in spring boot & Spring Data Mongo DB

I implemented the Scheduler in spring boot and the application is deployed to 3 pods. this scheduler is connected to 2 Mongo DB collections. 1st collection has id, name, indexId, state. in the implementation, find all the documents that has state…
0
votes
1 answer

How does Spring Kafka's @Retryable Annotation Implement Asynchronous Exception Handling?

I'm studying Spring Kafka, and I came across the @Retryable annotation, which supposedly implements retry logic asynchronously according to the annotation's comments. However, while examining the code at my level, I couldn't find any logic that…
0
votes
0 answers

Spring Retry - Failing to ignore thread creation processes

I am implementing Spring Retry, specifically for dead-lock scenarios, and there are several threads that get created further within my service (sending emails, etc). The issue I am facing is the lack of control of whether or not these threads should…
Mark Park
  • 13
  • 1
  • 6
0
votes
0 answers

Spring Boot Retry Logic

@Retryable(retryFor = SQLException.class, maxAttempts = 2, backoff = @Backoff(delay = 100)) void retryServiceWithCustomization(String sql) throws SQLException; I want to make retry for 5 secs first 60 mins . After 60 mins , retry should be every 30…
0
votes
1 answer

Configure default error handler to commit messages after recovery

I would like to retry consuming a message on processing/deserialiation failure for a finite number of times. After the retries are exhausted, I would like to log a message, commit the offset and move ahead with consuming further messages. For this…
tinku
  • 27
  • 1
  • 6