DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
There are a couple of ways the JAX-RS client could be configured, depending on the client implementation. Apache CXF provides its own WebClient which could be configured just like that (in future versions, there would be a simpler ways to do that using client specific features):
| Code Block | ||
|---|---|---|
| ||
// Configure the spans transport sender
final Sender sender = ...;
/**
* For example:
*
* final Sender sender = LibthriftSender.create("localhost");;
*/
final Tracing brave = Tracing
.newBuilder()
.localServiceName("web-client")
.reporter(AsyncReporter.builder(sender).build())
.traceSampler(Sampler.ALWAYS_SAMPLE) /* or any other Sampler */
.build();
Response response = WebClient
.create("http://localhost:9000/catalog", Arrays.asList(new BraveClientProvider(brave)))
.accept(MediaType.APPLICATION_JSON)
.get();
|
The configuration based on using the standard JAX-RS Client is very similar:
| Code Block | ||
|---|---|---|
| ||
// Configure the spans transport sender
final Sender sender = ...;
/**
* For example:
*
* final Sender sender = LibthriftSender.create("localhost");;
*/
final Tracing brave = Tracing
.newBuilder()
.localServiceName("jaxrs-client")
.reporter(AsyncReporter.builder(sender).build())
.traceSampler(Sampler.ALWAYS_SAMPLE) /* or any other Sampler */
.build();
final BraveClientProvider provider = new BraveClientProvider(brave);
final Client client = ClientBuilder.newClient().register(provider);
final Response response = client
.target("http://localhost:9000/catalog")
.request()
.accept(MediaType.APPLICATION_JSON)
.get(); |
...