Estou fazendo um projeto no STS e ele precisa do Ribbon, mas pelo que pesquisei ele foi descontinuado, tentei até alterar ao POM.xml para versão antetiror:
Alterando para: <version>2.3.4.RELEASE</version>:
Caramba, até sabia que alguns componentes do netflix deixaram de ser suportados pelo spring cloud, mas não sabia que o ribbon também já estava depreciado.
Implementei seguindo a documentação do Spring, mas deu erro em outro local: 20 21-04-22 19:00:13.475 ERROR 22108 --- [io-8101-exec-10] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is feign.FeignException$ServiceUnavailable: [503] during [GET] to [http://hr-worker/workers/2] [WorkerFeignClient#findById(Long)]: [Load balancer does not contain an instance for the service hr-worker]] with root cause
feign.FeignException$ServiceUnavailable: [503] during [GET] to [http://hr-worker/workers/2] [WorkerFeignClient#findById(Long)]: [Load balancer does not contain an instance for the service hr-worker]
Neste ainda não consegui achar a causa, procurei o erro no Stack Over Flow mas não encontrei nenhuma resposta consistente.
Agora a mensagem mudou, inserido na application.properties: spring.cloud.loadbalancer.ribbon.enabled=false
Apresenta: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'paymentResource': Unsatisfied dependency expressed through field 'service'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.claytoncalixto.hrpayroll.services.PaymentService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.cloud.client.loadbalancer.LoadBalanced(), @org.springframework.beans.factory.annotation.Autowired(required=true)}
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'paymentResource': Unsatisfied dependency expressed through field 'service'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'paymentService': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'hr-worker' in value "${hr-worker}"
Quando for postar o código, evite mandar imagens (isso não ajuda). Copie o código e poste na resposta.
Sobre o problema, no exemplo do site, ele usa um objeto diferente do resttemplate para fazer as requisições (WebClient). Talvez soh funcione da forma como está no tutorial do link que tinha te passado.
Vou dá uma olhada no tutorial de novo para ver se consigo de ajudar melhor.