0

I have just started with microservices and to learn I am working on this project
The problem is although my services are registered at Eureka Server. OpenFeing is not picking up the url. It is picking up the service name instead for the url.

The Problem
enter image description here
Check registered services

Registed Services

Application Properties

Server
server.port=8761

spring.application.name=eureka-server
eureka.client.register-with-eureka=false
eureka.client.fetch-registry=false
Top layer (the one that'll consume other services)
spring.application.name=top-service
server.port=8080
eureka.client.service-url.defaultZone=http://localhost:8761/eureka

Bottomlayer (the one that'll be consumed)
spring.application.name=bottom-service
server.port=8082
eureka.client.service-url.defaultZone=http://localhost:8761/eureka

Open Feign Interface
@FeignClient(value = "bottom-service")
public interface AppFeignClient {
    @GetMapping
    public String test();

}



Please checkout this github repo in case entire code is required

Danish Javed
  • 369
  • 1
  • 3
  • 10

1 Answers1

0

I was missing path in my feign client. Updated that to

@FeignClient(value = "bottom-service", path = "/bottom")
public interface AppFeignClient {
    @GetMapping
    public String test();
}

Not it works fine. Although the url still uses the service name like but it is able to fetch data with the same url

enter image description here

Danish Javed
  • 369
  • 1
  • 3
  • 10