Questions tagged [retrytemplate]
15 questions
4
votes
1 answer
StreamRetryTemplate for Spring Cloud Streams not retrying in integration tests
We are utilizing Spring Cloud Streams that listen to a Kafka topic and call a rest service. We also implement a custom StreamRetryTemplate to specify what kind of errors we deem recoverable and which we do not. I cannot get consistent results…

chas spenlau
- 325
- 1
- 2
- 12
3
votes
0 answers
What should I do with BackOffInterruptedException in Spring's RetryTemplate?
I'm going through automatic error reports from my desktop application, and I have this exception which I'm not sure how to handle:
java.lang.InterruptedException: sleep interrupted
at java.lang.Thread.sleep(Thread.java)
at…

Pablo Fernandez
- 279,434
- 135
- 377
- 622
2
votes
1 answer
Spring RetryTemplate execute retry only on specific type of response (not on an exception)
Background: I am calling a REST API to download a text file from a spring boot app. The problem is that the server takes time to generate the file and then make it ready for download.
So, I am using RetryTemplate to wait for 1 minute and attempt 60…

AMagic
- 2,690
- 3
- 21
- 33
2
votes
1 answer
Spring RetryTemplate return usage
For example I've a Spring RetryTemplate configuration:
@Configuration
@EnableRetry
public class RetryTemplateConfig {
@Bean
public RetryTemplate retryTemplate() {
SimpleRetryPolicy retryPolicy = new SimpleRetryPolicy();
…

takotsubo
- 666
- 6
- 18
1
vote
0 answers
How to catch a specific exception using retry template
I am trying calling a number of services, each service is dependent on the previous call.
Each call I have created my own retry logic but I have only recently discovered the Spring retry template and would like to use it.
So I've created the…

bootlover123
- 111
- 1
- 8
1
vote
1 answer
Spring Retry with RetryTemplate in Spring Boot, Java8
I am using Spring Boot 2.1.14.RELEASE, Java8, Spring Boot.
I have a client from which I have to access another rest service.
I need to retry an Http404 and HTTP500 2 times whereas not retry any other exceptions.
I am using RestTemplate to invoke the…

coder0h1t
- 443
- 5
- 9
1
vote
1 answer
Get the current backoff value when using Spring RetryTemplate
So I've been experimenting with Spring's Retry Template. Everything is working as expected. One thing I would like however is the ability to extract or log the current backoff time that's being used. I had a look through the docs/searched…

djkelly99
- 590
- 4
- 9
1
vote
1 answer
Retry feature is not working in Spring Batch
I have a batch job where i am using ScriptBatch.3.0.x version.
My use-case is to retry the job incase of any intermediate failures in between.
I am using the Chunk based processing and StepBuilderFactory for a job. I could not see any difference by…

TikTik
- 347
- 2
- 8
- 22
0
votes
1 answer
Kafka Listener : unable to prevent retry on a particular exception using SimpleRetryPolicy
I have a Kafka listener which can throw a JsonProcessingException and another custom exception (Lets say exception X) . I want kafka listener to retry only when a JsonProcessingException is thrown , and not when exception X is thrown.
To achieve…

Mayank Madhav
- 429
- 1
- 7
- 19
0
votes
1 answer
Spring Kafka Consumer Retry with backoff interval of long duration giving "org.apache.kafka.clients.consumer.CommitFailedException"
I am new to Spring-Kafka and trying to implement retry in case of failure or any exception during kafka message processing using Spring Kafka RetryTemplate.
I have used the following code:
//This is KafkaListenerContainerFactory:
public…

meena
- 67
- 2
- 9
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…

user12258186
- 37
- 7
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 =…

gowtham g
- 43
- 8
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
Spring retry with retryTemplate - unit tests
I am using retryTemplate and I have no idea how to do the unit tests for this. Can any one help?
I have this piece of code (for example) and I would like to test that the first time I call Card.create fails but the second one it…

Fany Castro Vizoso
- 311
- 2
- 17
-2
votes
2 answers
How to pass parameter to java lambda
I am using Spring RetryTemplate and using this method. Wanted to pass some argument (vendor) it is giving me compilation error. I can create a another variable vendorName as final can send it. But I want to make use the the variable vendor. It…

Kiran
- 839
- 3
- 15
- 45