Is it possible to disable the Retry (programatically) for all or any particular configuration in Resilience4J ?
There is no spring cloud.
Related
I'm using Spring Boot 2.3.3 along with Spring Retry 1.2.5.
We're replacing usages of Ribbon with Spring Cloud Load Balancer. One of the bits of functionality that I can't get to work is setting the max retries of our RestTemplates. In the old code we have these properties set:
client.ribbon.MaxAutoRetries: 2
client.ribbon.MaxAutoRetriesNextServer: 3
The documentation for for Spring Cloud Commons, Retrying Failed Requests indicates:
"The load-balanced RestTemplate honors some of the Ribbon configuration values related to retrying failed requests. You can use client.ribbon.MaxAutoRetries, client.ribbon.MaxAutoRetriesNextServer, and client.ribbon.OkToRetryOnAllOperations properties."
https://docs.spring.io/spring-cloud-commons/docs/2.2.4.RELEASE/reference/html/#retrying-failed-requests
I have Spring Retry added to my maven POM
I have #EnableRetry annotation on the Application startup class
I have the settings for MaxAutoRetries and MaxAutoRetriesNextServer set in the application.yml
I have RestTemplate bean defined with the #LoadBalanced annotation
The code works when all the services are running
When I shut down one of the services the RestTemplate is calling, the RestTemplate doesn't attempt to make the call multiple times as it's configured. I'm specifically interested in the MaxAutoRetriesNextServer as that's the most important bit.
Question 1:
What else do I need to do to get Spring Retry to make the RestTemplate retry, and retry on the next server etc.?
Question 2:
Why is the MaxAutoRetriesNextServer property not exposed on the Spring Retry api? I only see a property for setMaxAttempts in the SimpleRetryPolicy.
I have upgraded my SpringBoot project to 2.5.12 and the annotation #EnableCircuitBreaker is Deprecated. Is there a suitable replacement for that annotation?
Resilience4j is a new option for Spring developers to implement the circuit breaker pattern.
Resilience4j is a new option for Spring developers to implement the circuit breaker pattern.
Resilience4j comes with other features like Rate Limiter, Retry and Bulkhead along with Circuit Breaker pattern.
Resilience4j works well with spring boot and using micrometer libraries, it can emit metrics for monitoring.
There is no replacement introduced by Spring for Hystrix Dashboard so users need to use prometheus or NewRelic for monitoring.
I have a non boot spring application with micrometer integrated. Right now we are pushing these metrics to the logging file using LoggingRegistry.
We want to enhance this project to expose these metrics in the Rest API(we cannot use actuator as turning ON auto configuration is causing issues in our non boot application).Is there any way to expose these metrics which are automatically provided by the micrometer in the Rest API?
Any example will be appreciated?
You can add PrometheusMeterRegistry, it is for this use case, see the docs: https://micrometer.io/docs/registry/prometheus
I am trying to enable a hystrix stream in a Spring Cloud service, using Camden.SR1 in a spring boot app.
I enable hystrix by having a compile-time dependency:
compile 'org.springframework.cloud:spring-cloud-starter-hystrix'
and by adding a #EnableHystrix in the Application configuration.
The /mappings actuator shows the /hystrix.stream endpoint available but when I do a GET on it, the request hangs indefinitely.
I have tried the same using Brixton.SR6 (thus using Spring Boot 1.3) and the hystrix.stream endpoint works as expected.
Am I doing something wrong or is this a regression?
This issue seems linked with the Hystrix issue described here: https://github.com/Netflix/Hystrix/issues/1117. The workaround detailed here solves it https://github.com/Netflix/Hystrix/issues/1117#issuecomment-192222569
/hystrix.stream becames available amongst the actuator endpoints (add spring-boot-starter-hateoas and browse to /actuator). Regardless of any hystrix-enabled functionality in this service, this advertised endpoint should not hang.
i have embedded activemq broker in spring boot application, current solution for authentication is SimpleAuthentication plugin, but i need some solution that use spring security for activemq authentication. I can't find what i need, did someone know how to resolve this problem?
ActiveMQ leverages Apache Shiro for advanced security configurations.
You always write your own authentication plugin that uses Spring security