You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Jim Talbut <jt...@spudsoft.co.uk> on 2016/06/21 16:40:18 UTC
Self-registration of web services
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
Re: Self-registration of web services
Posted by Jim Talbut <jt...@spudsoft.co.uk>.
Thanks Chris.
Unfortunately, despite me arguing against it, I'm stuck with having to
use the company load balancer.
Given that, Docker seems like overkill (especially in complexity and
things to be understood by others).
Even if I did use DockerI'm still going to have to write the code to
interact with the LB, which ought to be the biggest bit of it.
Jim
On 21/06/2016 17:44, Christopher Riley wrote:
> Jim,
>
> Consider using Docker / Kubernetes or similar solution. That will handle
> the load balancer via a Kubernetes service which provides a static IP and
> the ports / internal IPs are masked from the user. They can use the IP or
> baked in DNS to then access the containers running spring-boot etc. Docker
> just announced similar functionality as part of the core Docker solution.
> If using a service in Kubernetes you just label your containers so the
> service knows how to map the generated / healthy containers to the static
> ip.
>
> Chris
>
> On Tue, Jun 21, 2016 at 12:40 PM, Jim Talbut <jt...@spudsoft.co.uk> wrote:
>
>> 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
>>
>>
>>
>
Re: Self-registration of web services
Posted by Christopher Riley <cr...@hkmconsultingllc.com>.
Jim,
Consider using Docker / Kubernetes or similar solution. That will handle
the load balancer via a Kubernetes service which provides a static IP and
the ports / internal IPs are masked from the user. They can use the IP or
baked in DNS to then access the containers running spring-boot etc. Docker
just announced similar functionality as part of the core Docker solution.
If using a service in Kubernetes you just label your containers so the
service knows how to map the generated / healthy containers to the static
ip.
Chris
On Tue, Jun 21, 2016 at 12:40 PM, Jim Talbut <jt...@spudsoft.co.uk> wrote:
> 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
>
>
>
--
Chris Riley, Partner
HKM Consulting LLC
(w) hkmconsultingllc.com
(o) 774.357.5900
(m) 508.273.3102
(f) 774.357.5905