quarkiverse / quarkus-neo4j

Quarkus Neo4j extension
Apache License 2.0
21 stars 5 forks source link

Enable sharing for devservices #296

Closed kdubb closed 4 days ago

kdubb commented 2 months ago

Quarkus devservices implementations can support sharing, one or more, containers between running Quarkus applications. This should be enabled.

Adding support involves:

  1. Add a property to enable disable sharing: quarkus.neo4j.devservices.sharing
  2. Add a property for sharing service name: quarkus.neo4j.devservices.service-name
  3. Label started container instances: quarkus-dev-service-neo4j with the value of the service name

In the devservices processor, if sharing is enabled, you first look to see if an existing container instance exists with label=quarkus-devservices-neo4j=<service-name>. If an instances has the required label & value, connect to that container instance, otherwise create a new container instance with the label & value.

Together, these allow a single instance (and using the service name multiple instances) to be shared between applications. However, each app can only be automatically configured to target a single instance.

michael-simons commented 1 month ago

Neat. I can start working on that November.