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

Call the retry listener from inside another listener maintaining with the whole retry Logic

We are using spring-kafka-2.2.8.RELEASE. I have an specific situation where I need help. I have 4 topics topic, retryTopic, successTopic and errorTopic. If topic fails, should be redirected to retryTopic where the 3 attempts to retry will be made.…
Lucas Lopes
  • 1
  • 1
  • 3
0
votes
1 answer

Retry with 30 minutes delay

I need to call a external rest service, if it fails on first attempt then I have to call again after 30 minutes. Max 3 time I can call like this. I know spring has RetryTemplate for the retry. But I feel, for my cases its not fit. I have to call…
0
votes
1 answer

Spring Retry maxAttempts does not behave

A very simple HelloWorld Test @Log4j2 @Service @EnableRetry @EnableScheduling public class MyBeanImpl { @Scheduled(cron = "0/2 * * * * ? ") @Retryable(value = {RuntimeException.class}, maxAttempts = 4, backoff = @Backoff(delay = 10000)) …
user1638172
  • 103
  • 2
  • 2
  • 6
0
votes
3 answers

@Recover (fallback method) is not getting invoked when used with @CircuitBreaker, once all the retry gets exhaused

Though with other return type Spring retry fallback mechanism seems to be working fine, but when it comes to calling an API with return type void. Recover method is not getting called at all, I have tried with all possible type of method parameters…
Arnav Karforma
  • 112
  • 2
  • 12
0
votes
0 answers

Spring boot execute second retry method after first retry method is successful

I wanted to create two retry methods. Where in second retry method is async method. It should be hit only after successful completion of first method. @Retryable(value = { LockedException.class }, maxAttempts = 3, backoff = @Backoff(delay =…
0
votes
2 answers

JUnit tests With Spring Boot 2.1.12 and Spring for Apache Kafka 2.2.12

Just trying to find out a simple example with Spring Boot 2.1.12 and Spring for Apache Kafka 2.2.12 that works with a KafkaListener, to retry last failed message. If a message fails, the message should be redirected to another Topic where the…
Lucas Lopes
  • 1
  • 1
  • 3
0
votes
1 answer

How to retry with spring kafka version 2..2

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 where the retries attempts will be made. We will have…
Lucas Lopes
  • 1
  • 1
  • 3
0
votes
1 answer

Does spring retry dependency covered under spring batch in spring initializr?

Trying to add Retry dependency in spring initializr, but only batch is showed? Does it mean need to add spring-batch and use retry?
J.J. Beam
  • 2,612
  • 2
  • 26
  • 55
0
votes
1 answer

Do I need hystrix dependency when I need @Retry and use spring initializr?

I gonna use @Retry in my Spring Boot MVC application while storing a data to DB with optimistic locking via @Version. I gonna retry multiple times when OptimisticLockException exception happens. And fall down after 100 times (for my logic it's a…
J.J. Beam
  • 2,612
  • 2
  • 26
  • 55
0
votes
1 answer

Consume messages from topic and retry with exponential backoff till it succeeds with Spring-Kafka-2.3.0 and above

Following are the configurations @Bean @Autowired public ConcurrentKafkaListenerContainerFactory kafkaListContFactory(@Qualifier("retryTemplate") RetryTemplate retryTemplate, @Qualifier("batchErrorHandler") ErrorHandler…
0
votes
0 answers

How to Apply a Spring Batch RetryTemplate to a Chunk based Step / ItemWriter?

I am working on a Spring Batch Program, that should Read a CSV file, Process it and then send it insert its content into a Database. The Jobs are startet via rest-Joblauncher (in case that helps). Its working most of the Time, but the SQL Connection…
eckad158
  • 385
  • 6
  • 19
0
votes
1 answer

@Retryable with exceptionExpression does not set any #root object neither variables

I'm using Spring Retry 1.2.4 with @Retryable annotation in a library dependency of a SpringBatch. In the exceptionExpression attribute I specify an expression #root.status.is5xxServerError() of a custom exception for which I mention the class in the…
pi lak
  • 67
  • 9
0
votes
1 answer

Aspectj pointcut not working with spring @Recover method in spring boot 2

I am using aop with spring boot 2.1.1, I have pointcut and advise to log calls and return values of methods annotated with custom annotation @LogAround @Pointcut("@annotation(x.y.z.LogAround)") public void logAroundJoinPoint()…
Pavan Kumar
  • 462
  • 5
  • 13
0
votes
4 answers

Spring boot @Value annotation returning null

I have a java class, shown below, that is creating a rest template with connection and read timeouts and also creates a retry template that is executing retries whenever a connection and read timeout occurs. I am reading in the values from an…
Dave Michaels
  • 847
  • 1
  • 19
  • 51
0
votes
1 answer

Does retrying to process a kafka message forever cause a consumer rebalance

I have a kafka consumer method annotated @kafkalistener. I have set the retry template on the container and the retry config is such that it would always retry for a couple of exceptions, if occurred while processing the msg. I have set…
RRV
  • 51
  • 8