Hi,
I have a bunch of services (too many) that I need to make self-registering.
At the moment most of these services are running as wars in tomcat, but
I'm going to be moving them to spring-boot (running as individual
processes using tomcat embedded).
Some of the services are SOAP, others are REST.
For each service I need to:
* Run the service on an unpredictable port.
* Identify the base URL for the service.
I'll need a consistent way to go from this to the WSDL or the
Swagger for the service.
I'll also need a consistent way to go from this to the JMX endpoints
for the JVM.
* Identify the service name, the domain (essentially just metadata for
the service) and the version for that service.
* Record the service details in a registry (probably Consul, but it's
not set in stone).
* Configure a load balancer (JetNexus) to use this URL for this
version of the service (creating the endpoint on the load balancer
as necessary).
I know how to do all of this except for the first hurdle.
I can't use publishedEndpointUrl because the port is unpredictable
(there will be an unpredictable set of services running on any given box).
I can get the servlet mappings, the port from Spring boot, and the
JAX-WS (haven't tried JAX-RS) endpoint details, but am I going about
this a bad way?
What is the recommended way to derive the full URL for a service outside
of the context of a request?
Thanks
Jim