Service Discovery using Consul with Path Variable

128 views Asked by At

I am using Consul for Service Discovery. Have a service called core-service where there is an API, which accepts a Path Variable, as -

@GetMapping("/records/status/{status}")

I need to discovery this API using DiscoveryClient.

My code is:

URI uri = discoveryClient.getInstances("core-service").stream().map(si -> si.getUri()).findFirst()
                .map(s -> s.resolve("/records/status/" + status)).get();

But I am receiving 404 Not found error. Pls guide.

0

There are 0 answers