I have a monolith application A, which needs to invoke a microservice B via service discovery . Consul is the service discovery server used. Microservice B is registered with the Consul server.
From A i am able to invoke B by giving http://hostname:portname/endpoint
How to do this via service discovery.
I tried adding the dependency spring-cloud-dependencies
in Monolith Application A so that i can use org.springframework.cloud.client.discovery.DiscoveryClient
to do the service discovery, but this spring dependency is bringing in embedded tomcat jar which is clashing with my jboss as both run on the default port of 8080
. converting monolith A into a springboot app just for the sake of service discovery isnt an option.
Is there a non spring option to do service discovery from a monolith application to a Consul server?
You can use a Consul aware loadbalancer such as https://traefik.io/ or https://github.com/fabiolb/fabio or a client-side load balancing solution such as https://linkerd.io/