Describes a `service`. The record is the only piece of information shared between consumer and provider. It should contains enough metadata to let consumer find the service they want.
Service Discovery main entry point.
The service discovery is an infrastructure that let you publish and find `services`. A `service` is a discoverable functionality. It can be qualified by its type, metadata, and location. So a `service` can be a database, a service proxy, a HTTP endpoint. It does not have to be a vert.x entity, but can be anything. Each service is described by a @see \io\vertx\jphp\servicediscovery\Record.
The service discovery implements the interactions defined in the service-oriented computing. And to some extend, also provides the dynamic service-oriented computing interaction. So, application can react to arrival and departure of services.
A service provider can:
* publish a service record * un-publish a published record * update the status of a published service (down, out of service...)
A service consumer can:
* lookup for services * bind to a selected service (it gets a @see \io\vertx\jphp\servicediscovery\ServiceReference) and use it * release the service once the consumer is done with it * listen for arrival, departure and modification of services.
Consumer would 1) lookup for service record matching their need, 2) retrieve the @see \io\vertx\jphp\servicediscovery\ServiceReference that give access to the service, 3) get a service object to access the service, 4) release the service object once done.
A state above, the central piece of information shared by the providers and consumers are @see \io\vertx\jphp\servicediscovery\Record.
Providers and consumers must create their own @see \io\vertx\jphp\servicediscovery\ServiceDiscovery instance. These instances are collaborating in background (distributed structure) to keep the set of services in sync.
Once a consumer has chosen a service, it builds a @see \io\vertx\jphp\servicediscovery\ServiceReference managing the binding with the chosen service provider.
The reference lets the consumer: * access the service (via a proxy or a client) with the @see \io\vertx\jphp\servicediscovery\ServiceReference::get method * release the reference - so the binding between the consumer and the provider is removed
The service exporter allows integrate other discovery technologies with the Vert.x service discovery. It maps entries from another technology to a and maps to a publication in this other technology. The exporter is one side of a service discovery bridge.
for event bus services (service proxies).
Consumers receive a service proxy to use the service.
for HTTP endpoint (REST api).
Consumers receive a HTTP client configured with the host and port of the endpoint.
Represents the location of a HTTP endpoint. This object (its json representation) will be used as "location" in a service record.