SDA Dropwizard Commons is a set of libraries to bootstrap services easily that follow the patterns and specifications promoted by the SDA SE.
SDA Dropwizard Commons is separated in different modules that can be combined as needed. Most of the modules require the technologies that are recommended for services in the SDA Platform. These technologies include
All modules prefixed with sda-commons-server-
provide technology and configuration support used in backend services
to provide REST Endpoints.
The main server modules help to bootstrap and test a Dropwizard application with convergent dependencies.
The module sda-commons-starter
provides all basics required to build
a service for the SDA Platform with Dropwizard.
The module sda-commons-starter-example
gives a small example
on starting an application using defaults for the SDA Platform.
The module sda-commons-server-testing
is the base module to add unit and
integration tests for applications in the SDA SE infrastructure.
Some modules have a more specialized testing module, e.g. the
sda-commons-server-hibernate
module has a
sda-commons-server-hibernate-testing
module, providing further
support.
The additional server modules add helpful technologies to the Dropwizard application.
The module sda-commons-server-auth
provides support to add authentication
using JSON Web Tokens with different sources for the public keys of the signing authorities.
The module sda-commons-server-circuitbreaker
provides support to
inject circuit breakers into synchronous calls to other services.
The module sda-commons-server-consumer
adds support to track or require a
consumer token identifying the calling application.
The module sda-commons-server-cors
adds support for CORS. This allows
Cross-origin resource sharing for the service.
The module sda-commons-shared-forms
adds all required dependencies to support
multipart/*
in Dropwizard applications.
The module sda-commons-server-dropwizard
provides
io.dropwizard:dropwizard-core
with convergent dependencies. All other SDA Dropwizard Commons Server modules use this dependency
and are aligned to the versions provided by sda-commons-server-dropwizard
. It also provides some common bundles that
require no additional dependencies.
The module sda-commons-server-healthcheck
introduces the possibility
to distinguish internal and external health checks.
The module sda-commons-server-healthcheck-example
presents a simple application that shows the usage of the bundle and implementation of new health checks.
The module sda-commons-server-hibernate
provides access to relational
databases with hibernate.
The module sda-commons-server-hibernate-exmaple
shows how
to use the bundle within an application.
The module sda-commons-server-jackson
is used for several purposes
- configure the
ObjectMapper
with the recommended default settings of SDA SE services. - provides support for linking resources with HAL
- adds the ability to filter fields on client request
- registers exception mapper to support the common error structure as defined within the rest guide
The module sda-commons-server-kafka
provides means to send and consume
messages from a Kafka topic.
The module sda-commons-server-kafka-example
includes
applications, one with consumer and one with producer examples.
The module sda-commons-server-key-mgmt
provides means to provide
and map enumerations (keys) between the API data model and a possible implementation.
The module sda-commons-server-spring-data-mongo
is used to work
with MongoDB using Spring Data Mongo.
The module sda-commons-server-mongo-testing
provides a MongoDB instance for integration testing.
The example
package shows how to use the bundle within an application.
The module sda-commons-server-opentelemetry
provides OpenTelemetry instrumentation for JAX-RS.
Other bundles like sda-commons-client-jersey
, sda-commons-server-spring-data-mongo
or sda-commons-server-s3
come with built-in instrumentation.
Besides instrumentation, it's also required to specify a collector, like Jaeger.
The module sda-commons-server-opentelemetry-example
shows how to use OpenTelemetry and Jaeger within an application and has examples for manual instrumentation.
The module sda-commons-server-prometheus
provides an admin endpoint to
serve metrics in a format that Prometheus can read.
The module sda-commons-server-prometheus-example
presents a simple application that shows the three main types of metrics to use in a service.
The module sda-commons-server-s3
provides a client for an
AWS S3-compatible object storage.
The module sda-commons-server-s3-testing
is used to
provide an AWS S3-compatible Object Storage during integrations tests.
The module sda-commons-server-security
helps to configure a secure
Dropwizard application.
The module sda-commons-shared-certificates
adds support for trusting custom certificate authorities.
The module sda-commons-server-trace
adds support to track create a
trace token to correlate a set of service invocations that belongs to the same logically cohesive call of a higher
level service offered by the SDA Platform, e.g. interaction service. .
The module sda-commons-server-weld
is used to bootstrap Dropwizard applications
inside a Weld-SE container and provides CDI support for servlets, listeners and resources.
The module sda-commons-server-weld-example
gives a small example on
starting an application within a Weld container.
The module sda-commons-shared-yaml
adds support for YAML-file handling.
All modules prefixed with sda-commons-client-
provide support for applications that use an HTTP client to access other
services.
The module sda-commons-client-jersey
provides support for using Jersey
clients withing the Dropwizard application.
The module sda-commons-client-jersey-wiremock-testing
bundles the WireMock dependencies to mock services in integration tests consistently to
sda-commons library versions.
The module sda-commons-client-jersey-example
presents an example application that shows how to invoke services.
The compiled releases are publicly available via maven central.
Include sda-commons-bom
and sda-commons-dependencies
as platform constraints. You will inherit
all versions defined there and won't have to specify versions for them yourself.
More details:
Note: You need Gradle 5.x for platform dependencies. More information can be found here.
project.ext {
sdaCommonsVersion = 'x.x.x'
}
dependencies {
// define platform dependencies for simplified dependency management
compile enforcedPlatform("org.sdase.commons.sda-commons-dependencies:$sdaCommonsVersion")
compile enforcedPlatform("org.sdase.commons.sda-commons-bom:$sdaCommonsVersion")
...
// Add dependencies to sda-commons-modules (managed by sda-commons-bom)
compile "org.sdase.commons:sda-commons-client-jersey"
...
// Add other dependencies (managed by 'sda-commons-dependencies')
compile 'org.glassfish.jersey.core:jersey-client'
// Add other unmanaged dependencies
compile 'org.apache.commons:commons-digester3:3.2'
}