spring-retry Questions

12

The following code is not retrying. What am I missing? @EnableRetry @SpringBootApplication public class App implements CommandLineRunner { ......... ......... @Retryable() ResponseEntity<...
Arty asked 5/7, 2016 at 20:49

3

Solved

I am using @Retryable on a method like this :- @Retryable( value = SQLException.class, maxAttempts = 5, backoff = @Backoff(delay = 100)) void testMethod(String abc) throws SQLException{ //some me...
Stellite asked 11/10, 2020 at 21:40

4

Solved

I have this test: @RunWith(MockitoJUnitRunner.class) public class myServiceTest { @InjectMocks myService subject; private myService spy; @Before public void before() { spy = spy(subject); } @...
Mote asked 13/9, 2016 at 20:42

5

Solved

Is Spring Retry guaranteed to work with Spring's @Transactional annotation? Specifically, I'm trying to use @Retryable for optimistic locking. It seems like it would be dependent on the ordering o...
Ransdell asked 5/4, 2018 at 17:53

3

Solved

I use compile 'org.springframework.retry:spring-retry:1.2.2.RELEASE'with Spring Boot 1.5.9.RELEASE. Configured to retry my method and it works well: @Retryable(value = { IOException.class }, maxA...
Giacometti asked 2/3, 2018 at 9:55

2

Solved

I am using the mix Spring-Cloud + feign + spring-retry to help retry requests on the client side (all are Kotlin-based back-ends) My spring-boot conf is like this: myApp: ribbon: OkToRetryOnAll...
Eileneeilis asked 9/8, 2018 at 14:48

3

Solved

I am testing a spring retry, but it seems the recover is not being called. Tried to get it work but it seems exhaustive. I passed to @Recover no argument, Throwable, Exception. Changed retry depend...
Demented asked 14/5, 2018 at 1:33

1

Solved

A little background I would like to call service's APIs, while doing retries on 5xx errors. Also, I would like to get an access to every failed request (for logging purposes). Code getClient() .ge...
Lennalennard asked 11/4, 2022 at 11:46

7

Solved

I have a restful service calling an external service using Spring Cloud Feign client @FeignClient(name = "external-service", configuration = FeignClientConfig.class) public interface ServiceClient...

3

Solved

Is it possible to set RetryPolicy in spring retry (https://github.com/spring-projects/spring-retry) based on error status code? e.g. I want to retry on HttpServerErrorException with HttpStatus.INTE...
Foushee asked 1/12, 2014 at 19:56

2

Solved

I found a problem when doing spring-retry with spring boot. When a class implements an interface, it cannot enter the @recover method after exceeding the maximum number of retries. But when I injec...
Accomplish asked 5/11, 2018 at 7:56

3

Solved

I am using Spring-Retry for some database operations. On a SQLRecoverableException I retry three times (this assumes that whatever is causing the exception is non-transient if it fails three times)...
Glare asked 1/9, 2015 at 5:32

3

According to the spring batch/retry documentation (http://docs.spring.io/spring-batch/reference/html/retry.html) in section 9.2 one can specify which exceptions you would like to retry or not retry...
Linguini asked 15/4, 2014 at 20:51

1

Solved

I have a method which I'm trying to test @Retryable(value = {SocketTimeoutException.class}, backoff = @Backoff(delay = 10000), maxAttempts = 4) public String getNewString(String oldString) throws...
Cotter asked 5/8, 2020 at 12:0

2

Solved

I am developing against a PostgreSQL v12 database. I am using SERIALIZABLE transactions. The general idea is that when PostgreSQL detects a serialization anomaly, one should retry the complete tran...
Aglaia asked 23/11, 2019 at 10:4

1

Solved

I have a Spring Cloud Stream project using the Kafka binder and I'm trying to understand and eventually customize the RetryTemplate used by Cloud Stream. I'm not finding a lot of documentation on ...

1

I have following method which is @Retryable: @Retryable(value = HttpClientErrorException.class) public Integer callToExternalService(DateTime start, DateTime end) throws MyException My questio...
Habitant asked 28/4, 2020 at 17:50

4

Solved

I have a method with the following signature: public Optional<String> doSomething() { ... } If I get an empty Optional I'd like to retry this method and only after 3 times return the empt...
Centaur asked 4/2, 2019 at 17:38

1

Just trying to find out a simple example with spring-kafka 2.2 that works with a KafkaListener, to retry last failed message. If a message fails, the message should be redirected to another Topic w...
Envious asked 11/2, 2020 at 15:28

2

Solved

I tried spring retry framework with Simple java classes using SimpleRetryPolicy/RetryTemplate. It worked fine. So I thought of doing the same with Annotations. Annotations never worked for me. Didn...
Lanlana asked 28/10, 2016 at 15:9

3

How to register a listener in spring-retry using @Retryable() annotation? @Bean public RetryListener myRetryListener() { return new MyRetryListener(); } @Service public class SampleService { pr...
Consanguinity asked 16/12, 2017 at 9:54

2

@Retryable(value = Exception.class, maxAttempts = 3) public Boolean sendMessageService(Request request){ ... } maxAttempts argument in @Retryable annotation is hard coded. Can i read that value ...
Eurasian asked 23/6, 2016 at 22:43

1

Solved

I am trying to make my Service Method retrying on failure with Springs @Retryable. @Retryable(backoff = @Backoff(delay = 1000), maxAttempts = 3) @Transactional(rollbackFor = Throwable.class) publi...
Cule asked 6/2, 2019 at 17:18

1

Solved

I created sample Spring-boot application and it works fine without any error, now I want to practice spring-retry to retry some of the methods. If i don't use @EnableRetry my application starts wi...
Ioyal asked 10/12, 2018 at 5:0

1

I am using annotation based approach - @Retryable to do retry in spring boot application. @Retryable(value = {DataAccessException.class, JpaSystemException.class}, maxAttempts = Integer.MAX_VALUE...
Fairtrade asked 31/10, 2018 at 9:14

© 2022 - 2025 — McMap. All rights reserved.