Offer a Quarkus Dev Services compatible way to launch Kafka and PostgreSQL containers with API server #1188
Labels
component/api-server
dx
Issues related to developer experience (DX)
enhancement
New feature or request
good first issue
Good for newcomers
p3
Nice-to-have features
size/M
Medium effort
Current Behavior
Currently, local development on the API server requires Kafka and PostgreSQL to be launched via Docker Compose.
While this works, it's a bit fiddly and not a good experience for new contributors.
Quarkus has Dev Services, which can automatically launch containers for infrastructure dependencies such as message buses and databases. Further, multiple services can discover and re-use existing containers started by another service.
The API server, being based on Alpine, does not offer a comparable capability. However, Dependency-Track v4.x already offers a dev-only feature to enable the H2 web console (DependencyTrack/dependency-track#2592), which can only be enabled through the
h2-console
Maven profile.Proposed Behavior
Implement a new dev-only capability to automatically start Kafka and PostgreSQL containers.
Optimally, make it so that containers started by the API server can be reused by Quarkus services, and vice versa. This needs a bit of investigation as to how Quarkus performs discovery on existing containers. Based on my current understanding, container labels play a role.
Similar to the H2 console, leverage a Maven profile to ensure that production builds will not have this behavior.
Implementation notes:
ServletContextListener
so it's run on application startupweb.xml
so it executes before the database or Kafka clients are initializedChecklist
The text was updated successfully, but these errors were encountered: