Can one setup Spring Boot 2.6 and Spring Cloud 2021.x to use Ribbon and Hystrix with Spring WebClient and Feign? - spring-cloud

I know that Spring Cloud at some version (3.0?) dropped direct support for some Netflix libraries like Ribbon or Hystrix. Now I'm trying to make a smooth migration of around 20 microservices running on production having some custom code extending Ribbon (and Hystrix to a lesser degree). The main goal is to upgrade from Spring Boot 2.3 to 2.6. As a consequence I need to upgrade Spring Cloud to 3.1.x, right?
My guess was to proceed with 2-step upgrade to avoid a one big-step migration:
Upgrade to Spring Boot 2.6 and Spring Cloud 3.1 while still using Ribbon and Hystrix
Make a way through a jungle of an old code and getting rid of Ribbon and Hystrix in smaller increments.
However to achieve this I'm trying to use simultanously Spring Boot 2.6, Spring Cloud with release train 2021.01 and 2 selected starters from older Spring Cloud (latest versions of these artifacts):
spring-cloud-starter-netflix-hystrix 2.2.10.RELEASE
spring-cloud-starter-netflix-ribbon 2.2.10.RELEASE
Is this possible at all? We are heavilly using Feign and Spring WebClient - client-side load-balancing must work for these. So far I found out Feign clients are not automatically integrated with Ribbon.
#spencergibb #OlgaMaciaszek - especially counting on you.

Answering my own question after receiving confirmation from Spring Cloud team by other means: this is a bad idea to try use Ribbon with Spring Cloud 2021.01 and it would require a really hard work to make it working.
So short answer is: "no".

Related

Software vulnerabilities on transitive deps of Spring Boot - Upgrade(2.2 to 2.6.6) issues with Zuul/Gateway and Cloud Load Balancer/Ribbon

We run Zuul/Spring Boot Admin/Spring Config Server/Eureka Server all on the same server. In the process of upgrading to latest Spring Boot(to pass our Veracode scan), we had multiple roadblocks and now trying to figure out my options. Below are some options we tried
Upgraded the vulnerable transitive dependencies(of Spring Boot 2.2.13.RELEASE) without upgrading Spring Boot. Ended up with either compilation or runtime issues
Upgraded to 2.6 and made respective Cloud Config changes successfully, and had to specify Zuul with version 2.2.10.RELEASE as Maven BOM won't bring this anymore. Ended up with errors mentioned in Zuul Forwarding error, Load balancer does not have available server for client. we have yet to try out solution mentioned in this post, but, hesitant to do this
Upgraded to 2.6 and converted Zuul routes to Spring Cloud Gateway. This apparently won't work as Eureka doesn't work with Webflux and Gateway needs Webflux. Ended up with errors mentioned in Could not initialize Eureka servlet context
Hoping for potential solutions that meet the following two desires
Still run Eureka and Zuul/Gateway on same server - Just to avoid infrastructure changes at this point
Do not want to specify the URLs of services i.e instead use Eureka to get list of instances/servers. If we put complete URL for Zuul my-service.routes.path, it seem to work. Also, there are other solutions which are suggesting the same to specify comma separated instances/urls which I want to avoid.
We are very aware that Ribbon and Zuul are no longer supported. That said, are we missing any other option ?
Vulnerable deps:
xstream 1.4.15
thymeleaf-spring5-3.0.12.RELEASE.jar (This was the one we couldn't upgrade. Rest of them we could add as direct dep and bump the version)
spring-beans-5.2.12.RELEASE.jar

Spring Cloud OpenFeign vs WebClient

For Spring Boot based microservices communicating with each other via load-balanced clients (with Spring Cloud LoadBalancer) which client should be used, WebClient or OpenFeign?
From what I’ve read they both support Spring Cloud LoadBalancer. I know that WebClient also supports reactive, but that is not a feature we need.
Are both clients going to continue to be supported by Spring for the foreseeable future?
From what I can see Spring seems to be pushing WebClient. However, I still see development activity going on in the spring-cloud-openfeign github repo.
OpenFeign seems to be an easier/cleaner to use way of creating the clients, but are there any drawbacks compared to WebClient?

Configuring Spring Cloud Stream in Camden.SR5 with Spring boot 1.5.1

First off, thanks to the Spring team for all their work pushing this work forward!
Now that Camden.SR5 is official, I have some questions on how to correctly configure the spring cloud stream kafka binder when using Spring Boot 1.5.1.
Spring boot 1.5.1 has auto configuration for kafka and those configuration options seem to be redundant with those in the spring cloud stream kafka binder.
Do we use the core spring boot properties (spring.kafka.) or do we use (spring.cloud.stream.kafka.binder.)?
I did find this issue, but I am curious if this work will be included in the next Camden release?
https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/73
Additionally, I saw this issue reported on Stack Overflow and I believe it will also be an issue with Camden.SR5?
Failed to start bean 'inputBindingLifecycle' when using spring-boot:1.5.1 and spring-cloud-stream
Thanks
Supporting the Boot 1.5 configuration options is an issue in progress. Also, since dedicated 1.5 support is coming only with Spring Cloud Stream Chelsea release train (which is included in the Dalston release of Spring Cloud), it will be available only there.
Also, when using Spring Cloud Camden with Boot 1.5 you will need to override the Kafka dependencies as described in Failed to start bean 'inputBindingLifecycle' when using spring-boot:1.5.1 and spring-cloud-stream. This will be avoided in future versions of Spring Cloud Stream (and Spring Cloud) but only starting in the Chelsea release train of Spring Cloud Stream (and the Dalston release of Spring Cloud) - see https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/88 for details.

use spring cloud config in web application without spring boot

i want to know is there any way to use spring cloud config client without spring boot in a spring web application.
i want to use spring cloud config with #Value annotation and i don't like to use spring cloud server rest api in my web application
i have tried what developers said in Spring Cloud Config Client Without Spring Boot link but it didn't work
Yes it's possible. You will have to add spring boot but don't have to really use it (we had it working in a non-springboot app). Check this code here https://github.com/4finance/micro-infra-spring/tree/master/micro-infra-spring-config . You don't need a config server then to use the properties. I don't have a code snippet for that but you would have to create manually a spring boot context in your just to make this work. Also check this answer - Spring Cloud Config Client Without Spring Boot . Even if you will make it work it doesn't mean that the ordering will be proper.
The suggested solution then is to actually use Spring Boot :)
I provided an answer here : Spring Cloud Config Client Without Spring Boot that can help you. It's a working prototype to load property sources from Zookeeper using Spring Cloud Config Zookeeper in a webapplication without Spring Boot.

Can Hystrix be used without Eureka/ Ribbon or other Netflix OSS modules

We have an infrastructure with our own API gateway, service discovery and load balancing. However for resiliency purposes I need to use Hystrix.
With spring cloud netflix, can Hystrix (i.e. The circuit breaker annotation) be used without Eureka/ Ribbon or other Netflix OSS modules?
Are there any dependency to Eureka/ Ribbon / Zuul for circuit breaker dashboard (i.e. turbine and stream aggregator) ?
Can circuit breaker annotation be used in a non spring-boot application?
Spring Cloud Hystrix can be used without ribbon or eureka, just use spring-cloud-starter-hystrix. The hystrix dashboard can be used by directly going to each instances hystrix.stream one at a time. Hystrix can be used without spring boot if you use the Netflix package directly without using Spring Cloud.
Yes
No idea, run it and see if it pulls the dependencies.
Yes if it's used with spring and you declare all the necessary beans that spring boot with otherwise instantiate. Otherwise no (more in the FAQ - Can annotations be used?
I would suggest you to google a bit before posting questions like this, as it's on the edge of asking for a tool, which is not a suitable question for SO.