...
The actual invocation of the request by the client (with process name jaxrsclient/192.168.0.100) and consequent invocation of the service on the server side (process name jaxrsserver/192.168.0.100) is going to generate the following sample traces:
Example #3: Client and Server trace with timeline
In this example server-side implementation of the JAX-RS service is going to add timeline to the active span. The client-side code stays unchanged.
Code Block | ||||
---|---|---|---|---|
| ||||
@Produces( { MediaType.APPLICATION_JSON } )
@GET
public Collection<Book> getBooks(@Context final TracerContext tracer) throws Exception {
tracer.timeline("Preparing Books");
// Simulating some work using a delay of 100ms
Thread.sleep(100);
return Arrays.asList(
new Book("Apache CXF Web Service Development", "Naveen Balani, Rajeev Hathi")
);
} |
The actual invocation of the request by the client (with process name jaxrsclient/192.168.0.100) and consequent invocation of the service on the server side (process name jaxrsserver/192.168.0.100) is going to generate the following sample traces:
Example #4: Client and Server with annotated trace (key/value)
In this example server-side implementation of the JAX-RS service is going to add key/value annotations to the active span. The client-side code stays unchanged.
Code Block | ||||
---|---|---|---|---|
| ||||
@Produces( { MediaType.APPLICATION_JSON } )
@GET
public Collection<Book> getBooks(@Context final TracerContext tracer) throws Exception {
final Collection<Book> books = Arrays.asList(
new Book("Apache CXF Web Service Development", "Naveen Balani, Rajeev Hathi")
);
tracer.annotate("# of books", Integer.toString(books.size()));
return books;
} |
The actual invocation of the request by the client (with process name jaxrsclient/192.168.0.100) and consequent invocation of the service on the server side (process name jaxrsserver/192.168.0.100) is going to generate the following sample server trace properties:
Example #5: Client and Server with parallel trace (involving thread pools)
TODO
Example #6: Client and Server with asynchronous JAX-RS service (server-side)
TODO