Changing a work project's version to java 17 resulted in the need to increase the spring-cloud-starter-openfeign to 3.0.6 (part of the 2020.0.0 Spring Cloud release train). Since Spring Cloud Netflix Ribbon has been deprecated and is not included in the 2020.0.0 release train, I have to make some changes in my project and switch to using Spring Cloud LoadBalancer.
After reading some articles I got the following understanding: Feign was using Ribbon as a LoadBalancer. Ribbon was configured in a properties file with different lists of hosts for all the applications clients.
My questions are:
- How am I supposed to use Spring Cloud LoadBalancer since I did not manage to find any comprehensible examples for me?
- Since I am using SpringCloudOpenFeign 3.0.6, which would be the suitable spring-cloud-starter-loadbalancer version? I have tried using 3.0.5( but I get a Unexpected exception during bean creation; nested exception is java.lang.IllegalArgumentException: @RequestMapping annotation not allowed on @FeignClient interfaces) and also 3.1.0 (and I get java.lang.ClassNotFoundException:org.springframework.cloud.client.loadbalancer.LoadBalancerClientsProperties); did not find any related info for neither of the errors on google