quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.73k stars 2.67k forks source link

[Database Dev Services] [Postgres] Database dev services starts although quarkus.datasource.reactive.url is configured #28911

Closed coiouhkc closed 1 year ago

coiouhkc commented 1 year ago

Describe the bug

Postgres database dev services starts although quarkus.datasource.reactive.url is configured

Expected behavior

As per documentation, database dev services should not start, see https://quarkus.io/guides/dev-services#databases

Actual behavior

No response

How to Reproduce?

See https://github.com/coiouhkc/short-and-sweet-quarkus-intro/tree/bug-or-feature/devservices-dynamic-postgres-port

quarkus.datasource.devservices.enabled=true
quarkus.datasource.devservices.username=postgres
quarkus.datasource.devservices.password=postgres
#quarkus.datasource.devservices.port=5432

quarkus.datasource.db-kind=postgresql
quarkus.datasource.username=${quarkus.datasource.devservices.username}
quarkus.datasource.password=${quarkus.datasource.devservices.password}
quarkus.datasource.reactive.url=vertx-reactive:postgresql://localhost:${quarkus.datasource.devservices.port}/postgres

still starts the database dev service (based on the log output): INFO [io.qua.dat.dep.dev.DevServicesDatasourceProcessor] (build-65) Dev Services for the default datasource (postgresql) started.

Output of uname -a or ver

Linux xps15 5.15.0-52-generic #58-Ubuntu SMP Thu Oct 13 08:03:55 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

openjdk version "11.0.16.1" 2022-08-12 LTS

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.13.1.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.6.3

Additional information

No response

quarkus-bot[bot] commented 1 year ago

/cc @geoand, @stuartwdouglas

coiouhkc commented 1 year ago

See https://github.com/quarkusio/quarkus/pull/28902, also https://quarkusio.zulipchat.com/#narrow/stream/187030-users/topic/Fix.20the.20Postgres.20listening.20port.20property.20with.20DevServices

geoand commented 1 year ago

cc @yrodiere

coiouhkc commented 1 year ago

Clarified by @maxandersen in Zulip - explicitely enabling devservices is not same as being implicitly enabled by default and thus forces it to start postgres container; works as designed.