use of demo.jaxrs.tracing.GoogleBooksApi in project cxf by apache.
the class Catalog method search.
@GET
@Path("/search")
@Produces(MediaType.APPLICATION_JSON)
public JsonObject search(@QueryParam("q") final String query, @Context final TracerContext tracing) throws Exception {
final GoogleBooksApi api = Feign.builder().client(new TracingClient(new ApacheHttpClient(), tracing.unwrap(Tracer.class))).target(GoogleBooksApi.class, "https://www.googleapis.com");
final feign.Response response = api.search(query);
try (final Reader reader = response.body().asReader()) {
return Json.createReader(reader).readObject();
}
}
Aggregations