Skip to content
This repository has been archived by the owner on Oct 22, 2018. It is now read-only.

Latest commit

 

History

History
24 lines (20 loc) · 554 Bytes

service-consumption.adoc

File metadata and controls

24 lines (20 loc) · 554 Bytes

Consuming a Snoop Service

  1. Discover the Service

  2. Call the service

    1. Use the Client API.

      String helloResponse = helloService.simpleGet("hello")
                    .filter(r -> r.getStatus() == 200)
                    .map(r -> r.readEntity(String.class))
                    .orElse("goodbye");
    2. Or use WebTarget directly.

          try {
             WebTarget endpoint = helloService.getServiceRoot();
             ...
          } catch(SnoopServiceUnavailableException e) {
             ...
          }