TracEE binding for JAX-RS2

This module can be used to add TracEE context propagation support to JAX-RS 2 webservices and JAX-RS 2 webservice clients.

Please add the following dependency to enable TracEE JAX-RS 2.x (JSR 339) support. For example in maven-style projects add to the pom.xml:

<dependencies>
<!-- … -->
    <dependency>
        <groupId>io.tracee.binding</groupId>
        <artifactId>tracee-jaxrs2</artifactId>
        <version>RELEASE</version> <!-- You should specify a version instead -->
    </dependency>
<!-- … -->
</dependencies>

Container-Configuration

Implicit

If you don’t use an explicit application config and have the tracee-jaxrs2 module on your classpath, all filters will be automatically applied to your JAX-RS services.

Explicit Application configuration

If you use an explicit Application class, you need to add TraceeContainerFilter as provider classes.

Example:

@ApplicationPath("/myApplication")
public class ApplicationConfig extends Application {

    public Set<Class<?>> getClasses() {
        return new HashSet<Class<?>>(Arrays.asList(
        io.tracee.binding.jaxrs2.TraceeContainerFilter.class, );
    }
}

Using JAX-RS 2 client

You have to register the TraceeClientFilter as provider classes when you build your client to enable TracEE support for JAX-RS2 clients.

final Client client = ClientBuilder.newClient()
    .register(io.tracee.binding.jaxrs2.TraceeClientFilter.class);
final Response response = client.target(ENDPOINT_URL).request().get();

License

This project is released under the revised BSD License.

Social Links

Imprint

Web-Template based on SOLID by Carlos Alvarez and remixed according to the Creative Commons Attribution 3.0 License.