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
0
votes
1 answer

How to implement Retry logic in RabbitMQ?

In my project I'm setting SimpleRetryPolicy to add custom exception and RetryOperationsInterceptor which is consuming this policy. @Bean public SimpleRetryPolicy rejectionRetryPolicy() { Map, Boolean>…
0
votes
1 answer

Spring retry - Thread interruption handling

I am using spring-retry v1.3.1 with @Retryable annotation and I have a few questions on its behaviour. Let's say that in my spring boot application I have a retry configuration that makes my application wait 1 hour before retrying. If my application…
Sekki
  • 99
  • 1
  • 2
  • 8
0
votes
1 answer

Spring retry exception handling execution behavior

I am trying to get to the best way to wrap spring-retry @Retryable annotation around external service call. Here is my code: @Retryable(exclude = HttpClientErrorException.BadRequest.class, value = RestClientException.class) private…
linuxNoob
  • 600
  • 2
  • 14
  • 30
0
votes
0 answers

Spring Retry, RestTemplate, and client.ribbon.MaxAutoRetriesNextServer

I'm using Spring Boot 2.3.3 along with Spring Retry 1.2.5. We're replacing usages of Ribbon with Spring Cloud Load Balancer. One of the bits of functionality that I can't get to work is setting the max retries of our RestTemplates. In the old code…
0
votes
0 answers

Spring JPA transaction partially retry

I am trying to use Spring retry for my Spring web application (with JPA, hibernate). Currently, I have a long transaction chain (marked functions as @Transactional) in my application, intuitively: start transction -> A() -> B() -> C() -> D() - E()…
Daniel Hua
  • 153
  • 2
  • 8
0
votes
1 answer

How to use Spring @Retryable as a meta-annotation and support listeners?

I have a code base with several nearly-identical usages of @Retryable, all driven by the same configuration values. So I created a new annotation that's annotated with ("inherits") @Retryable, like this: @Documented @Retention(RUNTIME) @Target({…
E-Riz
  • 31,431
  • 9
  • 97
  • 134
0
votes
0 answers

Retryable on WebFlux

I've have a method which is annotated with @Scheduled and @Retryable. This method work fine with Mvc but the same method is not working on Webflux. The scheduler works fine but Retryable is not happening. This happens only on Webflux. …
sea
  • 113
  • 8
0
votes
1 answer

Performance comparison of RetryTemplate vs ErrorHandler

I have two ways of recovering from KafkaListener errors with using RetryTemplate in the KafkaListener method: @KafkaListener(topics: "topic1") public void handle(command) { retryTemplate.execute(ctx -> { processCommand(command); …
sansari
  • 558
  • 1
  • 7
  • 17
0
votes
1 answer

Kafka listeners with different retry attempts

I have three spring @KafkaListeners, all consuming from the same topic, but I need to have different retry attempts for each listener which results in having different RetryPolicy I guess. I am on version 2.7.11 right now; Should I define three…
sansari
  • 558
  • 1
  • 7
  • 17
0
votes
0 answers

Circuit Breaker implementation on function binding process/consume with spring cloud stream kafka

Here is my sample process and consume bean which I have set in function binding in application I would like to add a circuit breaker to these functions but it won't work since these beans are just being read during project build. Goal is: I would…
0
votes
1 answer

Difference between StatefulRetryOperationsInterceptor and RetryOperationsInterceptor

I went through the javadoc of both StatefulRetryOperationsInterceptor and RetryOperationsInterceptor but still didn't understand the difference between. Can anyone explain to me the difference between them and when to use them. Below is the…
0
votes
1 answer

does Spring allow to configure retry and recovery mechanism for KafkaTemplate send method?

Trying to build a list of possible errors that can potentially happen during the execution of kafkaTemplate.send() method: Errors related serialization process; Some network issues or broker is down; Some technical issues on broker side, for…
user471011
  • 7,104
  • 17
  • 69
  • 97
0
votes
1 answer

Runtime modification of Spring @Retryable maxAttempts value

Scenario : I need to modify maxAttempts value of @Retryable at runtime, so that the number of retries can be driven from database @Service public class PropertyHolder { private int retryCount= 2; public int retryCount() { return retryCount; } …
Suresh Anbarasan
  • 943
  • 1
  • 8
  • 20
0
votes
1 answer

StatefulRetryOperationsInterceptor not working when included with TransactionInterceptor in interceptor chain

I have the below configuration in application context xml file
0
votes
1 answer

Retry restTemplate pos on response body parameter

I'm making integration with a web service. There is an api post method that can return a "good" response with a body like: { "result": "Ok" } or if something bad happens it returns this: { "result": "Failure" } I need to retry the POS…
darth jemico
  • 605
  • 2
  • 9
  • 18