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

RetrySynchronizationManager.getContext().getRetryCount() always returns zero

I have a strange case with spring-retry @Retryable I have the following play code in order to test the retry functionality of Spring and on pseudo random times to either retry or finish an execution. @Scheduled(fixedRate = 10000) @Retryable(value…
Alexius DIAKOGIANNIS
  • 2,465
  • 2
  • 21
  • 32
0
votes
0 answers

resilience4j retry - pass method argument to event listener

I am trying to work on poc using resilience4j retry libs to replace spring retry. I have a question if someone can help point me to right direction: spring retry has listener support which has open(RetryContext rtx, ..) method, which is called…
Kiras
  • 69
  • 6
0
votes
1 answer

Inject values into custom DeadLetterPublishingRecoverer

I have a custom dead letter recoverer which I've implemented so that I could override the createProducer method protected ProducerRecord createProducerRecord(ConsumerRecord record, TopicPartition topicPartition,…
feenix110998
  • 61
  • 1
  • 7
0
votes
1 answer

Migrating from spring-kafka 2.7.14 to 3.0.1

We are migrating from spring 5 to 6. I am encountering issues with following methods related to spring-kafka. SetErrorHandler deprecated in favor of CommonErrorHandler -> i replaced this with setCommonErrorHandler(Recoverer,Back…
0
votes
1 answer

Spring Retry not retrying in Spring Batch

I have a config file that has: @Configuration @ComponentScan(basePackages = { "xxxxxxxx", "xxxxxxxx" }) @EnableBatchProcessing @Import(DataSourceConfig.class) @EnableRetry public class BatchConfiguration extends DefaultBatchConfigurer { and another…
mike628
  • 45,873
  • 18
  • 40
  • 57
0
votes
1 answer

spring-retry 2.0.0 - cannot access org.springframework.retry.annotation

Last working version was 1.3.4 which has some vulnerabilities, for this reason updated latest version org.springframework.retry spring-retry
0
votes
1 answer

Error Handling - protobuf message to DLT instead of Retry in case of connection exception

I've implemented an KafkaListener using SpringBoot 2.7.6, Confluent platform and now I need to implement the Error Handler for it. The listener manages to pick up a protobuf topic message and POST the payload to an HTTP endpoint properly. But in…
0
votes
1 answer

ServiceActivator use only one advice instead of 2 advices fro retrying and error filtering

Do I really need to define 2 advices over ServiceActivator (RequestHandlerRetryAdvice) if I need to use RetryTemplate (with AlwaysRetryPolicy) and ExpressionEvaluatingRequestHandlerAdvice where I filter the error that I don't want to retry…
YerivanLazerev
  • 353
  • 3
  • 17
0
votes
1 answer

Why are Spring retry's stateful retries necessary with transactional resources?

In Spring retry's README, they mention how a "stateless retry" is not enough to rollback a transaction, but a stateful retry can by using a Map ? I don't really understand what they mean. If I want a transactional method to rollback the transaction…
negimaster
  • 65
  • 1
  • 4
0
votes
2 answers

Spring @Retryable vs WebFlux retry

Could somebody help with understanding the difference between using @Retryable on metod which contains WebFlux client call and retries that are supported by WebFlux itself (e.g. retryWhen)?
MainS
  • 120
  • 1
  • 6
0
votes
0 answers

Handle unretryable exceptions on producer Kafka [Spring-boot]

I want to be able to catch unretryable exceptions when sending a message through kafkaTemplate and then send the message to a different error topic where I can investigate the message. How it's easier to implement such a behavior on consumer side…
0
votes
1 answer

Springboot @retryable listeners is invoked when retry is not triggered

I am using @Retryable like following where I am retrying a db save function in a service class. I want to tract the retrying. But the retry functions are always invoked in the listener. PeopleService.java package com.test.demo; import…
quidstone
  • 55
  • 1
  • 8
0
votes
1 answer

Beans are null when unit testing spring-retry with SpringRunner

I am trying to write unit tests for a class having spring retry using the springRunner. But my @Autowired beans are null . Could you please let me know what I did wrong? Below is my test…
mkdir 404
  • 1
  • 2
0
votes
1 answer

How to use exceptionExpression in Spring Retryable?

So I have a basic method which already has @Retryable annotation. I recently came across "exceptionExpression" to suppress retry based on some condition. I want to know what are some of the ways I can use this exceptionExpression. I have tried…
0
votes
1 answer

Can we add specific condition in @Retryable for any exception in spring-retry?

I have a class which has @Retryable annotation added to method with value as custom exception and maxAttempts =2 . @Override @Retryable(value = CustomException.class, maxAttempts = 2) public void process(String input) { //code…