Introduction to Service Locator
Additionally, it allows service providers to automatically register and unregister their service endpoints. In this way, the providers actively advertise the availability of their service endpoints to consumers.
The Service Locator consists of two parts:
-
The Service Locator server hosting an endpoint repository.
-
The CXF feature used to enable usage of the locator for CXF service consumers and providers.
Like any standard CXF feature, it has separate functionalities for service and consumer:
-
when the provider becomes available or unavailable, a provider-side Locator Feature extension registers and deregisters service endpoints respectively in the endpoint repository.
-
when a service call to a provider is about to be made, a consumer-side Locator Feature extension transparently retrieves service endpoint addresses from the endpoint repository.
It is also possible to restrict access to the Service Locator (for example, to restrict updates permissions), please see Restricting access to the Service Locator for more details.
Since creating a distributed, fault-tolerant endpoint repository is a non-trivial task, the Service Locator server implementation is based on proven open source technology - Apache ZooKeeper. This is a highly reliable service that provides coordination between distributed processes. To learn more about Apache ZooKeeper, see http://zookeeper.apache.org/.