Skip to content
devlibx edited this page Jan 17, 2023 · 3 revisions

Use the following link to create a Java 19 rest project

Java 19 Project


Java 19 with Dropwizard - Full Virtual Thread Support

These are changes required in your dropwizard project to enable Virtual Thread (Loom support)

  1. This requires the latest dropwizard version 3.0+
  2. This requires the Jetty 10.0+ version - Jetty added virtual thread support in these versions
  3. Use of jakarta.ws.rs-api -> javax package is replaced with jakarta so all Jetty resources must user jakarta packages
  4. Enhanced server factory io.github.devlibx.easy.app.dropwizard.SimpleServerFactoryWithVirtualThread. This uses virtual thread instead of a native thread
    • To enable it, you must add the following file in META-INF in your project
resources
  META-INF
    services
       io.dropwizard.core.server.ServerFactory

# COntent of this file
io.github.devlibx.easy.app.dropwizard.SimpleServerFactoryWithVirtualThread
  1. Use service type as simplewithvt
server:
  type: simplewithvt
  applicationContextPath: "/"
  adminContextPath: "/admin"
  connector:
    port: 8090
    type: HTTP
Clone this wiki locally