jZenith Logo

An opinionated approach to building modern Java Microservices

View project on GitHub

REST Plugin

Snapshots are published to the Sonatype OSS repository.


The REST Plugin gives you

  • Resteasy with enabled validation
  • A health check endpoint at /health
  • A Prometheus metriecs endpoing at /metrics/prometheus
  • A Swagger/OpenAPI endpoint at /openapi.json

The Rest Plugin can be enabled by calling

                   .withMapping(NoSuchUserException.class, 404));

Resources are default JAX-RS resources that will run via Resteasy. Mappings are custom exception mappings to allow custom error codes for your domain exceptions.

Due to the great support for RxJava in Resteasy you can define Resources that look like this

    public Single<UserResponse> getUser(@NonNull @PathParam("id") final UUID id) {
        return userService.getById(id)

Configuration properties

defined in RestConfiguration

  • rest.port: port to bind to
  • rest.host: host to bind to