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

Retrying with Spring Retry based on error message or status code?

I am using the spring-retry dependency and currently have a Java Spring Boot application class annotated with @EnableRetry, and a function annotated with the below @Retryable(value = MongoException.class, maxAttempts = 4, backoff = @Backoff(delay…
MisterIbbs
  • 247
  • 1
  • 7
  • 20
0
votes
0 answers

RetryTemplate not working for Spring boot application

I am trying to add retry utility to a non-bean class method on multiple types of exceptions: InternalServerError and BadGatewayErrorr. From taking the idea of my earlier post: @Retryable annotation not working for non Spring Bean class method, I did…
Joy
  • 4,197
  • 14
  • 61
  • 131
0
votes
1 answer

@Retryable -> value property doesn't work as expected

I'm having a weird problem with @Retryable annotation. It suppose to be fired only with the defined exception classes on value property: @Retryable(value = {IllegalArgumentException.class}, maxAttempts = 2, backoff = @Backoff(delay = 50)) But, it's…
0
votes
1 answer

how to print delay sequence in spring retry

I know to print number of counts inside retryable method. how to print delay sequence inside retryable method @Retryable( value = SQLException.class, maxAttempts = 3, backoff = @Backoff(delay = 1000)) void testMethod(String abc) throws…
Velmurugan A
  • 348
  • 3
  • 7
0
votes
1 answer

Spring Batch : How to add ExponentialBackOffPolicy along with the existing SimpleRetryPolicy?

I have the following SimpleRetryPolicy defined and it works as it should be.
One Developer
  • 99
  • 5
  • 43
  • 103
0
votes
1 answer

Spring retry sending duplicate request

I can see in the logs that Spring retry is sending 2 requests to the remote server and both requests return successful responses. I am not able to get the reason behind the same. Code: Class StatusClient{ …
Chandresh Mishra
  • 1,081
  • 3
  • 24
  • 45
0
votes
3 answers

Spring Retry doesn't work with a try-catch block

I have a method that I want to retry when SQLRecoverableException occurs. I annotated the method with @Retryable(value={SQLRecoverableException.class}) and enabled Retry in my application. However, this specific method includes a try-catch block to…
L Mo
  • 1
  • 1
  • 1
0
votes
1 answer

Log the exceptions thrown in spring kafka listener

We are using Spring kafka 2.7 non blocking retry mechanism. We want to log the error thrown while consuming the data in our @KafkaListener method. For example:…
0
votes
2 answers

Execute 2 mthods in a songle transaction with separate Retry logic

Below is my requirement begin trans insertData(); updateData(); end trans Also lets say insertDta method throws some error then I need to retry 5 times .Same with updateData().I should not retry both the methods at the same time i.e if i retry m2()…
0
votes
2 answers

@Retryable with @Scheduled don't fire

I've written a Spring Boot Application where I've enabled Spring Batch Scheduling and Retriable as follow: @SpringBootApplication @EnableBatchProcessing @EnableScheduling @EnableRetry public class FilldashboardApp { } I've defined a controller as…
Joe Taras
  • 15,166
  • 7
  • 42
  • 55
0
votes
1 answer

StoredProcedureItemReader not able to retry on java.sql.SQLTimeoutException

I am having difficulty in getting my StoredProcedureItemReader to Retry after it fails due to SQLTimeoutException. Here is the configuration for my step process: @Bean public Step Step() throws Exception { return…
Vamsi
  • 619
  • 3
  • 9
  • 22
0
votes
0 answers

spring-rabbit & spring-retry, how does x-message-ttl works?

I'm using spring and rabbitmq, with auto-ack. I configured a RetryInterceptor (maxAttempts 2, min and max interval 60 secs., multiplier 1), and a x-message-ttl (125 sec. for this test) is configured in the queue. I have only 1 concurrent consumer. I…
abullor
  • 51
  • 4
0
votes
1 answer

Test with EmbeddedKafka - prove number of retries

I have a test written using @EmbeddedKafka. I have error handling configured using SeekToCurrentErrorHandler. I have a test where I push a message onto Kafka and I can see it handled by the DeadLetterPublishingRecover correctly where it publishes to…
Kinght007
  • 59
  • 1
  • 10
0
votes
1 answer

Spring retry template with proxy

I have a RestTemplate that has a proxy set up such as Proxy proxy = new Proxy(Type.HTTP, new InetSocketAddress(config.getProxyHost(), config.getProxyPort())); SimpleClientHttpRequestFactory requestFactory = new…
hocikto
  • 871
  • 1
  • 14
  • 29
0
votes
1 answer

How to Configure a RetryTemplate in Spring Batch with Java Configuration

I am trying to set up a RetryTemplate in Spring Batch, I just cannot find an example on how to add the RetryTemplate into the StepBuilderFactory. I've found this example to set it up in a SpringBoot Application,…
msuzuki
  • 105
  • 2
  • 15