I just wanted to try dev services for spinning up a config free postgres in docker as I read at https://quarkus.io/guides/datasource#dev-services-configuration-free-databases
Generated a quarkus project https://code.quarkus.io/ with dependency quarkus-jdbc-postgresql
and application.properties looks like
quarkus.datasource.devservices.enabled=true
quarkus.datasource.db-kind=postgresql
quarkus.datasource.devservices.port=5432
Starting quarkus does NOT spin up postgres, instead I get a warning that quarkus does not understand its own properties, see Quarkus Log
2022-03-09 23:11:14,433 WARN [io.qua.config] (Quarkus Main Thread) Unrecognized configuration key "quarkus.datasource.devservices.enabled" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo
2022-03-09 23:11:14,433 WARN [io.qua.config] (Quarkus Main Thread) Unrecognized configuration key "quarkus.datasource.devservices.port" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo
2022-03-09 23:11:14,433 WARN [io.qua.config] (Quarkus Main Thread) Unrecognized configuration key "quarkus.datasource.db-kind" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo
2022-03-09 23:11:14,936 INFO [io.quarkus] (Quarkus Main Thread) quarkus-resteasy-postgres 1.0.0-SNAPSHOT on JVM (powered by Quarkus 2.7.4.Final) started in 2.182s. Listening on: http://localhost:8080
2022-03-09 23:11:14,937 INFO [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2022-03-09 23:11:14,937 INFO [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, jdbc-postgresql, resteasy, smallrye-context-propagation, vertx]
Any idea what is going on here?
Project here: https://github.com/syr/quarkus-resteasy-postgres
CodePudding user response:
According to your warning message, there's one extension missing for this configuration:
2022-03-09 23:11:14,433 WARN [io.qua.config] (Quarkus Main Thread) Unrecognized configuration key "quarkus.datasource.db-kind" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo
You can solve your problem adding one of these dependencies to your project (on your pom.xml):
Pool your database connections (included in Hibernate ORM)
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-agroal</artifactId>
</dependency>
or
Hibernate ORM
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-hibernate-orm</artifactId>
</dependency>