Skip to content

[mongodb] devservice executed when host provided #40414

Closed
@dcdh

Description

Description

When the quarkus.mongodb.connection-string is provided the mongo devservice do not launch a container because the developer wants to use the mongo instance provided.

This behavior is defined here: https://github.com/quarkusio/quarkus/blob/main/extensions/mongodb-client/deployment/src/main/java/io/quarkus/mongodb/deployment/DevServicesMongoProcessor.java#L150

When the quarkus.mongodb.hosts is used to define a connection instead of quarkus.mongodb.connection-string a mongo container is created and started by the devservice at startup. Is it possible to not start a container to use the hosts provided ?

Implementation ideas

Replace this:

boolean needToStart = !ConfigUtils.isPropertyPresent(configPrefix + "connection-string");

by

boolean needToStart = !ConfigUtils.isPropertyPresent(configPrefix + "connection-string") && !ConfigUtils.isPropertyPresent(configPrefix + "hosts");

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions