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

Using RequestHandlerRetryAdvice as per-class advice

In the Spring Core Advice API docs there are two kinds of advice defined: per-class advice - which must not "depend on the state of the proxied object or add new state" per-instance advice - that "adds state to the proxied…
0
votes
1 answer

Tuning RetryPolicy in spring-retry based on HttpStatus status code?

Is it possible to set RetryPolicy in spring retry based on error status code? e.g. I don't want to retry on HttpClientErrorException with HttpStatus.BAD_REQUEST status code, which is 400. Therefore it should ignore all other error codes -- 4XX. I am…
Moulesh Kumar
  • 131
  • 2
  • 16
0
votes
0 answers

Using spring-retry @EnableRetry with spring-batch causes unexpected proxy

I am trying to make use of the spring-retry library in my batch job and on adding the @EnableRetry annotation to my @Configuration as documentation suggests my application is now failing because it appears a spring-batch library bean which is being…
dapperwaterbuffalo
  • 2,672
  • 5
  • 35
  • 48
0
votes
1 answer

Annotation for retrying all methods in a class instead of using @Retryable for each method

We use @Retryable annotation to retry specific methods in a class. Is there any annotation to commonly retry all methods in a class.Instead of making it in method level, can we move to Class level.
superuser33333
  • 113
  • 1
  • 11
0
votes
0 answers

@Retryable is not working with @EventListener Spring

I have a method in class that is also a component. The method have the following annotations: @Retryable( value = { Exception.class }, maxAttempts = 2, backoff=@Backoff(delay = 2000)) @Async @EventListener For some resaon the…
nufar
  • 77
  • 2
  • 8
0
votes
1 answer

Regarding Retry with Spring

I am calling a webservice in my Application which has authentication tokens that can expire. In case of token expiry, I need to refresh the token and retry the webservice. To do this, I felt spring retry might be the right candidate. But I have no…
David John
  • 179
  • 1
  • 11
0
votes
1 answer

Spring AMQP message resiliency in case broker connectivity down

I have a Use Case of managing Spring AMQP client message resiliency in case of RabbitMQ server connectivity down, For the same I have used Spring Retry RabbitTemplate template = // get template from some bean RetryTemplate retryTemplate = new…
Akshat
  • 575
  • 2
  • 12
  • 28
0
votes
1 answer

Spring Retry Junit: Testing Retry template with Custom Retry Policy

I'm trying to test a Retry template which is using a custom Retry Policy. In order to do that, I'm using this…
Columb1a
  • 463
  • 2
  • 11
  • 25
0
votes
1 answer

Spring Retry: NeverRetryLogic Not working as I expected with ExceptionClassifierRetryPolicy

I'm working in a retry scenario (related to an http outbound gateway). The retry logic is working very well, but my logic to not retry looks like has a bug. What I would like to do is to not retry if I get an http status error different to…
Columb1a
  • 463
  • 2
  • 11
  • 25
0
votes
2 answers

Using Spring-retry with Dropwizard

Is it possible to make use of spring-retry within dropwizard? Or, for that sake, is there something like spring-retry in dropwizard?
0
votes
1 answer

Spring batch 3, error at configuration load on IBM JVM (BackToBackPatternClassifier)

I get an error when lauching a spring batch Job with IBM's JRE 1.7. Spring Batch version is 3.0.7, Spring version is 4.3.5 This error is not happening with Oracle JDK 1.7. It appears when I load my Spring Batch XML Configuration,…
Sky
  • 99
  • 1
  • 11
0
votes
1 answer

In Spring Integration app, Is it possible to test a Spring Retry mechanism outside of chain?

I've inherited a Spring Integration project that incorporates Spring Retry. I'm not sure it has ever been tested out, and there is no separate tests for it. So I'm trying to exercise it with a simple scenario. By mocking the RestTemplate exchange…
Les
  • 487
  • 1
  • 10
  • 22
0
votes
1 answer

spring amqp enable retry by configuration and prevent it according to a specified exception

I have the following two cases In case of ExceptionA : retrying for finite number of times and finally when number of retrials exhausted, message is written in a dead letter queue In case of ExceptionB : simply, message should be written to dead…
Shady Ragab
  • 705
  • 10
  • 26
0
votes
2 answers

How to catch Spring Batch's ItemStreamException after @Retryable maxAttempts exceeded?

I have the following ItemReader: import org.springframework.batch.item.ExecutionContext; import org.springframework.batch.item.ItemStreamException; import org.springframework.batch.item.file.FlatFileItemReader; import…
James
  • 2,876
  • 18
  • 72
  • 116
0
votes
1 answer

How to use messageKeyGenerator in StatefulRetryOperationsInterceptor

I am trying implement sample retry mechanism for RabbitMQ using Spring's StatefulRetryOperationsInterceptor. As stated in documentation, I need to setup message key generator as the message id is absent. What I don't understand is the real usage of…
Atul Kumbhar
  • 1,073
  • 16
  • 26