Interface HttpDiscoveryService

All Superinterfaces:
DiscoveryService<HttpServiceInstance,UnboundExchange<?>,HttpTrafficPolicy>

public interface HttpDiscoveryService extends DiscoveryService<HttpServiceInstance,UnboundExchange<?>,HttpTrafficPolicy>

A discovery service for resolving HTTP services providing HttpServiceInstance in order to process HTTP requests.

It is typically used as follows, to resolve an HTTP service and process HTTP requests on one or more HTTP service instances.


 HttpClient httpClient = ...
 HttpDiscoveryService httpDiscoveryService = ...

 client.exchange("/path/to/resource")
     .flatMap(exchange -> httpDiscoveryService.resolve(ServiceId.of("http://example.org"))
     .flatMap(service -> service.getInstance(exchange))
         .map(serviceInstance -> serviceInstance.bind(exchange))
     )
     .flatMap(Exchange::response)
     ...
 
Since:
1.12
Author:
Jeremy Kuhn
See Also: