Skip to content

bastman/dropwizzard-kotlin-example

Repository files navigation

dropwizard-kotlin-example

playing around with dropwizard

status

  • experimental
  • in progress ...

run guicey app

  • mysql (docker): $ docker-compose -f docker/db/docker-compose.yml up --build
  • Program Arguments: server rest-service-guicy/src/main/resources/example-config.yml

findings

  • use dropwizard-guicey! (is inspired by hubspot dropwizard-guice) seems to be to best integratio with guice

Dropwizard Resource (api endpoints)

  • if you need access to HttpRequest, do not use @singleton in resource class (in spring-boot we preferable use singleton, HttpRequest is injected into method signature)

HK & Guice

exclude from classpath scan: @InvisibleForScanner

testing:

For web component tests (servlets, filters, resources) use DropwizardAppRule InjectorLookup.getInjector(RULE.getApplication()).getBean(MyService.class);

jdbi

jdbi kotlin plugins (requires jdbi3)

swagger:

exception handling