Skip to content

Quarkus Support #308

@devhawk

Description

@devhawk

From @jonjanisch commenting on #298:

I can share a Quarkus extension I created that may be a good starting point for something official. Quarkus extensions are a bit different than Spring. Quarkus moves all reflection to compile time to avoid scanning for annotations during prod application startup.

One of the cool things about the extension is it provides automatic registration with a single annotation provided by the extension. Here's a minimal example.

@DBOSWorkflow
public class ExampleWorkflowImpl implements ExampleWorkflow {

  @Workflow(name = "example-workflow")
  public void runWorkflow() {
     // .... normal workflow code
  }
}

This is almost a complete DBOS application (interface still needed). All the boilerplate of the registration process, launching, and shutting down DBOS is removed. The only other step is setting up the config in Quarkus's properties file:

quarkus.dbos.datasource.jdbc.url=jdbc:postgresql://localhost:5432/dbos_example
quarkus.dbos.datasource.username=postgres
quarkus.dbos.datasource.password=password
quarkus.dbos.conductor-key=dbos_12345
... etc

I was about to go crazy and remove the need for the interface, but that requires bytecode manipulation which I didn't really want to attempt. At first I thought having the singleton DBOS instance would be problematic. But in practice it hasn't caused any issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions