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

Exclude dependency and import other version

I want to be able to import org.springframework.retry:spring-retry:1.3.2-SNAPSHOT using Gradle. However, spring-retry dependency (of different version): org.springframework.retry:spring-retry:1.2.5.RELEASE is coming from…
user2769790
  • 123
  • 1
  • 17
0
votes
0 answers

Getting exception while using @Transaction on @Recover method

I'm trying to implement @Retryable and @Recover feature for my Database operation. See below my sample code @Retryable(value = {PriceUploadServiceException.class,RuntimeException.class}, maxAttempts = 3, backoff =…
0
votes
1 answer

How to retry for fixed amount of time after all previous retries are exhausted in Kafka consumer?

I am using exponential retry in Kafka consumer. And it is working as expected but I need to add some more configuration to it. Suppose after the maximum retry attempt, the request is still not successful then I need to retry it for a fixed time…
0
votes
1 answer

spring-kafka how to set Retry on the stream bean

I saw spring-kafka supports Non-Blocking Retries using @RetryableTopic. I only saw @RetryableTopic is working with @kafkaListener together. But I want the "Retry" on my stream aggregation. How to do that by spring-kafka? The code example below is…
Yao Dong
  • 113
  • 1
  • 3
  • 11
0
votes
1 answer

Spring @StreamListener: Infinite retries with exponential backoff

I'm trying to configure my consumer to work with an exponential backoff where the message will be processed a fixed number of attempts, applying among them the backoff period. But I don't get the expected behaviour. This is my Java…
Miguel
  • 536
  • 6
  • 20
0
votes
1 answer

Request/Reply and Retry Policy for Kafka Listeners

I’m currently implementing an error handling mechanism for Kafka Listeners. This is what I would like to achieve: when an exception occurs within a Kafka Listener, I want to retry processing my record 10 times and if it still fails, send it to a…
Jeremy
  • 31
  • 5
0
votes
1 answer

RetryListenerSupport handlers executed on all @Retryables

I checked out docs and it seems (and is intuitive) that you have to register a RetryListenerSupport within the @Retryable annotation listener's arg. But for some reason, the RetryListenerSupport gets executed on all @Retryables within the project,…
eja
  • 4,677
  • 3
  • 21
  • 30
0
votes
1 answer

Spring retry exceptionexpression

So I'm trying to retry for specific exceptions and created a bean which has shouldRetry(Throwable t) function. The function returns true if exception has to be retried, otherwise false. But What I'm observing is shouldRetry(Throwable t) is executing…
greeshma
  • 1
  • 2
0
votes
0 answers

UndeclaredThrowableException thrown in Spring Retry although the checked exception declared in method declaration

EDIT: I read the linked topic (Getting UndeclaredThrowableException instead of my own exception) carefully but it does not answer my question - that ticket suggests to declare the checked exception in the intercepted method which is what I already…
0
votes
1 answer

Testing @Retryable and @Recover methods in Spring Boot + Mockito

For one class e.g. called Class A, I call an external api (with exceptions and I have mocked the class). In Class B, I have a method that calls Class A's method with the potential exceptions that could occur. Class B has the @Retryable and @Recover…
user11720939
0
votes
0 answers

How to use property from a property file in the `@Backoff` annotation for customize delay time?

How to use property from a property file in the @Backoff annotation for customize delay time? This attribute takes only a constant as a value. I try to initialize someProperty field with constructor injection, but it not helps and IntellijIDEA shows…
Rinat
  • 362
  • 3
  • 14
0
votes
1 answer

SpringBoot testing with spring-retry

I had the following function (the function is not really important): fun myRandomFunc(something: String?): List { return listOf(5) } And you can imagine it was doing some API calls, returning list of some objects, etc. I could…
vukojevicf
  • 609
  • 1
  • 4
  • 22
0
votes
1 answer

Spring CircuitBreakerRetryPolicy: open the circuit for all requests

I want to implement the circuit breaker design pattern using Spring-Retry. The main problem that I am facing is opening the circuit for all requests. It still keeps retrying if I make a new request from the browser. I have a RetryTemplate with a…
Turik Mirash
  • 201
  • 2
  • 15
0
votes
1 answer

retryTemplate.execute not getting called

I am using retry template as below for an exception that might occur. The retryTemplate.execute block never gets called. I have defined the retrytemplate bean as below. Not sure if that's the correct way. I am new to java and spring. Any help will…
Suhana
  • 21
  • 2
0
votes
1 answer

Is there any way to retry different in method when a particular method failing (instead of retrying that failed method)

I have a requirement in which I have 2 methods (in different class) , in which one method makes Rest GET call to fetch token(which is like session token and valid for few seconds) and another method which append this retrieved token in headers and…
Priya
  • 143
  • 4
  • 17