Dev Servicesの概要
Quarkusは、開発およびテストモードでの未設定サービスの自動プロビジョニングをサポートしています。この機能をDev Servicesと呼んでいます。開発者の視点から見ると、エクステンションを含めてもそれを設定しなければ、Quarkusは自動的に関連するサービスを開始し(通常、舞台裏で Testcontainersを使用します)、このサービスを使用するためにアプリケーションを設定することを意味します。
この機能はすべて、Quarkus deployment
モジュールの一部であり、本番アプリケーションには一切影響しません。すべてのDev Servicesを無効にしたい場合は、 quarkus.devservices.enabled=false
構成プロパティを使用できますが、ほとんどの場合、サービスを構成するだけでDev Servicesが自動的に無効になるため、この設定は必要ありません。
なお、デフォルトの起動タイムアウトは60秒ですが、これでは不十分な場合は、 quarkus.devservices.timeout
プロパティで増やすことができます。
このページでは、QuarkusがサポートしているすべてのDev Servicesを紹介しています。
Dev Servicesを利用するには、通常、Dockerが動作する環境が必要です(リモート環境もサポートされています)。もしDockerがインストールされていない場合は、通常のサービスを設定する必要があります。 |
AMQP
AMQP Dev Serviceは、アプリケーションに quarkus-smallrye-reactive-messaging-amqp
エクステンションが存在し、ブローカー・アドレスが明示的に構成されていない場合に有効になります。詳細は、AMQP Dev Services Guideを参照してください。
ビルド時に固定される設定プロパティ - それ以外の設定プロパティは実行時に上書き可能
タイプ |
デフォルト |
|
---|---|---|
If Dev Services for AMQP has been explicitly enabled or disabled. Dev Services are generally enabled by default, unless there is an existing configuration present. For AMQP, Dev Services starts a broker unless Environment variable: |
boolean |
|
Optional fixed port the dev service will listen to. If not defined, the port will be chosen randomly. Environment variable: |
int |
|
The image to use. Note that only ActiveMQ Artemis images are supported. Specifically, the image repository must end with Environment variable: |
string |
|
The value of the Environment variable: |
string |
|
Indicates if the AMQP broker managed by Quarkus Dev Services is shared. When shared, Quarkus looks for running containers using label-based service discovery. If a matching container is found, it is used, and so a second one is not started. Otherwise, Dev Services for AMQP starts a new container.
The discovery uses the Environment variable: |
boolean |
|
The value of the Environment variable: |
string |
|
Apicurio Registry
Apicurio Dev Serviceは、アプリケーションに quarkus-apicurio-registry-avro
エクステンションが存在し、そのアドレスが明示的に設定されていない場合に有効になります。詳細は、 Apicurio Registry Dev Services Guideを参照してください。
ビルド時に固定される設定プロパティ - その他の設定プロパティはランタイムでオーバーライド可能です。
タイプ |
デフォルト |
|
---|---|---|
If Dev Services for Apicurio Registry has been explicitly enabled or disabled. Dev Services are generally enabled by default, unless there is an existing configuration present. For Apicurio Registry, Dev Services starts a registry unless Environment variable: |
boolean |
|
Optional fixed port the dev service will listen to. If not defined, the port will be chosen randomly. Environment variable: |
int |
|
The Apicurio Registry image to use. Note that only Apicurio Registry 2.x images are supported. Specifically, the image repository must end with Environment variable: |
string |
|
Indicates if the Apicurio Registry instance managed by Quarkus Dev Services is shared. When shared, Quarkus looks for running containers using label-based service discovery. If a matching container is found, it is used, and so a second one is not started. Otherwise, Dev Services for Apicurio Registry starts a new container.
The discovery uses the Environment variable: |
boolean |
|
The value of the Environment variable: |
string |
|
データベース
The database Dev Services will be enabled when a reactive or JDBC datasource extension is present in the application, and the database URL has not been configured. More information can be found at the Databases Dev Services Guide.
Quarkus provides Dev Services for all databases it supports. Most of these are run in a container, except H2 and Derby which are run in-process. Dev Services are supported for both JDBC and reactive drivers.
Those relational databases that are running in a container are started using Testcontainers and support "reusable instances"; this implies that if you add the property testcontainers.reuse.enable=true
in your Testcontainers configuration file, a property file named .testcontainers.properties
in your user home, then the databases will not be stopped aggressively after each run, and can be reused.
N.B. if you opt in for this feature, Quarkus will not reset the state of the database between runs unless you explicitly configure it to.
ビルド時に固定される設定プロパティ - それ以外の設定プロパティは実行時に上書き可能
タイプ |
デフォルト |
|
---|---|---|
If DevServices has been explicitly enabled or disabled. DevServices is generally enabled by default, unless there is an existing configuration present. When DevServices is enabled Quarkus will attempt to automatically configure and start a database when running in Dev or Test mode. Environment variable: |
boolean |
|
The container image name to use, for container based DevServices providers. If the provider is not container based (e.g. a H2 Database) then this has no effect. Environment variable: |
string |
|
Optional fixed port the dev service will listen to. If not defined, the port will be chosen randomly. Environment variable: |
int |
|
The container start command to use, for container based DevServices providers. If the provider is not container based (e.g. a H2 Database) then this has no effect. Environment variable: |
string |
|
The name of the database to use if this Dev Service supports overriding it. Environment variable: |
string |
|
The username to use if this Dev Service supports overriding it. Environment variable: |
string |
|
The password to use if this Dev Service supports overriding it. Environment variable: |
string |
|
Generic properties that are passed for additional container configuration. Properties defined here are database specific and are interpreted specifically in each database dev service implementation. Environment variable: |
|
|
Generic properties that are added to the database connection URL. Environment variable: |
|
|
If DevServices has been explicitly enabled or disabled. DevServices is generally enabled by default, unless there is an existing configuration present. When DevServices is enabled Quarkus will attempt to automatically configure and start a database when running in Dev or Test mode. Environment variable: |
boolean |
|
The container image name to use, for container based DevServices providers. If the provider is not container based (e.g. a H2 Database) then this has no effect. Environment variable: |
string |
|
Generic properties that are passed for additional container configuration. Properties defined here are database specific and are interpreted specifically in each database dev service implementation. Environment variable: |
|
|
Generic properties that are added to the database connection URL. Environment variable: |
|
|
Optional fixed port the dev service will listen to. If not defined, the port will be chosen randomly. Environment variable: |
int |
|
The container start command to use, for container based DevServices providers. If the provider is not container based (e.g. a H2 Database) then this has no effect. Environment variable: |
string |
|
The name of the database to use if this Dev Service supports overriding it. Environment variable: |
string |
|
The username to use if this Dev Service supports overriding it. Environment variable: |
string |
|
The password to use if this Dev Service supports overriding it. Environment variable: |
string |
Kafka
Kafka Dev Serviceは、アプリケーションに quarkus-kafka-client
エクステンションが存在し、ブローカー・アドレスが明示的に設定されていない場合に有効になります。詳細については、 Kafka Dev Services Guideを参照してください。
ビルド時に固定される設定プロパティ - それ以外の設定プロパティは実行時に上書き可能
タイプ |
デフォルト |
|
---|---|---|
If Dev Services for Kafka has been explicitly enabled or disabled. Dev Services are generally enabled by default, unless there is an existing configuration present. For Kafka, Dev Services starts a broker unless Environment variable: |
boolean |
|
Optional fixed port the dev service will listen to. If not defined, the port will be chosen randomly. Environment variable: |
int |
|
The Kafka container image to use.
Only Redpanda and Strimzi images are supported. Default image is Redpanda.
Note that Strimzi images are launched in Kraft mode. In order to use a Strimzi image you need to set a compatible image name such as Environment variable: |
string |
|
Indicates if the Kafka broker managed by Quarkus Dev Services is shared. When shared, Quarkus looks for running containers using label-based service discovery. If a matching container is found, it is used, and so a second one is not started. Otherwise, Dev Services for Kafka starts a new container.
The discovery uses the Environment variable: |
boolean |
|
The value of the Environment variable: |
string |
|
Timeout for admin client calls used in topic creation. Defaults to 2 seconds. Environment variable: |
|
|
Enables transaction support. Also enables the producer idempotence. Find more info about Red Panda transaction support on https://vectorized.io/blog/fast-transactions/. Notice that KIP-447 (producer scalability for exactly once semantic) and KIP-360 (Improve reliability of idempotent/transactional producer) are not supported. Environment variable: |
boolean |
|
The topic-partition pairs to create in the Dev Services Kafka broker. After the broker is started, given topics with partitions are created, skipping already existing topics. For example, Environment variable: |
|
期間フォーマットについて
期間のフォーマットは標準の 数値で始まる期間の値を指定することもできます。この場合、値が数値のみで構成されている場合、コンバーターは値を秒として扱います。そうでない場合は、 |
Keycloak
Keycloak Dev Serviceは、アプリケーションに quarkus-oidc
エクステンションが存在し、サーバ・アドレスが明示的に設定されていない場合に有効になります。詳細は, OIDC Dev Services Guideを参照してください。
ビルド時に固定される設定プロパティ - それ以外の設定プロパティは実行時に上書き可能
タイプ |
デフォルト |
|
---|---|---|
If DevServices has been explicitly enabled or disabled. When DevServices is enabled Quarkus will attempt to automatically configure and start Keycloak when running in Dev or Test mode and when Docker is running. Environment variable: |
boolean |
|
The container image name to use, for container based DevServices providers. Image with a Quarkus based distribution is used by default. Image with a WildFly based distribution can be selected instead, for example: 'quay.io/keycloak/keycloak:18.0.2-legacy'. Note Keycloak Quarkus and Keycloak WildFly images are initialized differently. By default, Dev Services for Keycloak will assume it is a Keycloak Quarkus image if the image version does not end with a '-legacy' string. Set 'quarkus.keycloak.devservices.keycloak-x-image' to override this check. Environment variable: |
string |
|
If Keycloak-X image is used. By default, Dev Services for Keycloak will assume a Keycloak-X image is used if the image name contains a 'keycloak-x' string. Set 'quarkus.keycloak.devservices.keycloak-x-image' to override this check which may be necessary if you build custom Keycloak-X or Keycloak images. You do not need to set this property if the default check works. Environment variable: |
boolean |
|
Indicates if the Keycloak container managed by Quarkus Dev Services is shared. When shared, Quarkus looks for running containers using label-based service discovery. If a matching container is found, it is used, and so a second one is not started. Otherwise, Dev Services for Keycloak starts a new container.
The discovery uses the Environment variable: |
boolean |
|
The value of the Environment variable: |
string |
|
The class or file system path to a Keycloak realm file which will be used to initialize Keycloak. Environment variable: |
string |
|
The JAVA_OPTS passed to the keycloak JVM Environment variable: |
string |
|
The Keycloak realm name. This property will be used to create the realm if the realm file pointed to by the 'realm-path' property does not exist, default value is 'quarkus' in this case. If the realm file pointed to by the 'realm-path' property exists then it is still recommended to set this property for Dev Services for Keycloak to avoid parsing the realm file in order to determine the realm name. Environment variable: |
string |
|
Indicates if the Keycloak realm has to be created when the realm file pointed to by the 'realm-path' property does not exist. Disable it if you’d like to create a realm using Keycloak Administration Console or Keycloak Admin API from Environment variable: |
boolean |
|
Optional fixed port the dev service will listen to. If not defined, the port will be chosen randomly. Environment variable: |
int |
|
The Keycloak users map containing the username and password pairs. If this map is empty then two users, 'alice' and 'bob' with the passwords matching their names will be created. This property will be used to create the Keycloak users if the realm file pointed to by the 'realm-path' property does not exist. Environment variable: |
|
|
The Keycloak user roles. If this map is empty then a user named 'alice' will get 'admin' and 'user' roles and all other users will get a 'user' role. This property will be used to create the Keycloak roles if the realm file pointed to by the 'realm-path' property does not exist. Environment variable: |
|
Kogito
アプリケーションに kogito-quarkus
または kogito-quarkus-processes
のいずれかのエクステンションがある場合、Kogito Dev Service が有効になります。詳細は、 Kogito Dev Services Guideを参照してください。
ビルド時に固定される設定プロパティ - その他の設定プロパティはランタイムでオーバーライド可能です
型 |
デフォルト |
|
---|---|---|
Dev Services が明示的に有効または無効化されている場合。Dev Services は通常、既存の設定がない限り、デフォルトで有効になっています。Dev Services が有効な場合、Quarkusは Devモード で実行しているときに、自動的にデータインデックスを構成して開始しようとします。 |
boolean |
true |
使用するコンテナイメージの名前です。 |
string |
quay.io/kiegroup/kogito-data-index-ephemeral |
Dev Services がリッスンする固定ポートを指定します。 定義されていない場合、ポートはランダムに選択されます。 |
int |
8180 |
Quarkus Dev Services によって管理されるデータインデックスインスタンスが共有されているかどうかを示します。共有されている場合、Quarkusはラベルベースのサービス検出を使用して、実行中のコンテナを検索します。一致するコンテナが見つかった場合、そのコンテナが使用されるため、2つ目のコンテナは起動されません。そうでない場合は、Dev Services for Kogito が新しいコンテナを起動します。ディスカバリーは |
boolean |
true |
The value of the |
string |
kogito-data-index |
MongoDB
MongoDB Dev Serviceが有効になるのは、アプリケーションに quarkus-mongodb-client
エクステンションがあり、サーバーアドレスが明示的に設定されていない場合です。詳細は MongoDB ガイドを参照してください。
ビルド時に固定される設定プロパティ - それ以外の設定プロパティは実行時に上書き可能
タイプ |
デフォルト |
|
---|---|---|
If DevServices has been explicitly enabled or disabled. DevServices is generally enabled by default, unless there is an existing configuration present. When DevServices is enabled Quarkus will attempt to automatically configure and start a database when running in Dev or Test mode. Environment variable: |
boolean |
|
The container image name to use, for container based DevServices providers. Environment variable: |
string |
|
Optional fixed port the dev service will listen to. If not defined, the port will be chosen randomly. Environment variable: |
int |
|
Generic properties that are added to the connection URL. Environment variable: |
|
RabbitMQ
RabbitMQ Dev Serviceは、アプリケーションに quarkus-smallrye-reactive-messaging-rabbitmq
エクステンションが存在し、ブローカーアドレスが明示的に構成されていない場合に有効になります。詳細については、 RabbitMQ Dev Services Guideを参照してください。
ビルド時に固定される設定プロパティ - それ以外の設定プロパティは実行時に上書き可能
タイプ |
デフォルト |
|
---|---|---|
If Dev Services for RabbitMQ has been explicitly enabled or disabled. Dev Services are generally enabled by default, unless there is an existing configuration present. For RabbitMQ, Dev Services starts a broker unless Environment variable: |
boolean |
|
Optional fixed port the dev service will listen to. If not defined, the port will be chosen randomly. Environment variable: |
int |
|
Optional fixed port for the RabbitMQ management plugin. If not defined, the port will be chosen randomly. Environment variable: |
int |
|
The image to use. Note that only official RabbitMQ images are supported. Specifically, the image repository must end with Environment variable: |
string |
|
Indicates if the RabbitMQ broker managed by Quarkus Dev Services is shared. When shared, Quarkus looks for running containers using label-based service discovery. If a matching container is found, it is used, and so a second one is not started. Otherwise, Dev Services for RabbitMQ starts a new container.
The discovery uses the Environment variable: |
boolean |
|
The value of the Environment variable: |
string |
|
Type of exchange: direct, topic, headers, fanout, etc. Environment variable: |
string |
|
Should the exchange be deleted when all queues are finished using it? Environment variable: |
boolean |
|
Should the exchange remain after restarts? Environment variable: |
boolean |
|
Extra arguments for the exchange definition. Environment variable: |
|
|
Should the queue be deleted when all consumers are finished using it? Environment variable: |
boolean |
|
Should the queue remain after restarts? Environment variable: |
boolean |
|
Extra arguments for the queue definition. Environment variable: |
|
|
Source exchange to bind to. Defaults to name of binding instance. Environment variable: |
string |
|
Routing key specification for the source exchange. Environment variable: |
string |
|
Destination exchange or queue to bind to. Defaults to name of binding instance. Environment variable: |
string |
|
Destination type for binding: queue, exchange, etc. Environment variable: |
string |
|
Extra arguments for the binding definition. Environment variable: |
|
Redis
Redis Dev Serviceは、アプリケーションに quarkus-redis-client
エクステンションが存在し、サーバー・アドレスが明示的に設定されていない場合に有効になります。詳細は、 Redis Dev Services Guideをご覧ください。
ビルド時に固定される設定プロパティ - それ以外の設定プロパティは実行時に上書き可能
タイプ |
デフォルト |
|
---|---|---|
If DevServices has been explicitly enabled or disabled. DevServices is generally enabled by default, unless there is an existing configuration present. When DevServices is enabled Quarkus will attempt to automatically configure and start a database when running in Dev or Test mode and when Docker is running. Environment variable: |
boolean |
|
The container image name to use, for container based DevServices providers. Environment variable: |
string |
|
Optional fixed port the dev service will listen to. If not defined, the port will be chosen randomly. Environment variable: |
int |
|
Indicates if the Redis server managed by Quarkus Dev Services is shared. When shared, Quarkus looks for running containers using label-based service discovery. If a matching container is found, it is used, and so a second one is not started. Otherwise, Dev Services for Redis starts a new container.
The discovery uses the Environment variable: |
boolean |
|
The value of the Environment variable: |
string |
|
If DevServices has been explicitly enabled or disabled. DevServices is generally enabled by default, unless there is an existing configuration present. When DevServices is enabled Quarkus will attempt to automatically configure and start a database when running in Dev or Test mode and when Docker is running. Environment variable: |
boolean |
|
The container image name to use, for container based DevServices providers. Environment variable: |
string |
|
Optional fixed port the dev service will listen to. If not defined, the port will be chosen randomly. Environment variable: |
int |
|
Indicates if the Redis server managed by Quarkus Dev Services is shared. When shared, Quarkus looks for running containers using label-based service discovery. If a matching container is found, it is used, and so a second one is not started. Otherwise, Dev Services for Redis starts a new container.
The discovery uses the Environment variable: |
boolean |
|
The value of the Environment variable: |
string |
|
Vault
Vault Dev Service は、アプリケーションに quarkus-vault
エクステンションが存在し、サーバー アドレスが明示的に設定されていない場合に有効になります。詳細については、 Vaultガイドを参照してください。
Neo4j
Neo4j Dev Serviceは、アプリケーションに quarkus-neo4j
エクステンションが存在し、サーバ・アドレスが明示的に設定されていない場合に有効になります。詳細は、 Neo4jガイドを参照してください。
Infinispan
Infinispan Dev Serviceは、アプリケーションに quarkus-infinispan-client
エクステンションが存在し、サーバ・アドレスが明示的に設定されていない場合に有効になります。詳細は Infinispanガイドに記載されています。
ビルド時に固定される設定プロパティ - それ以外の設定プロパティは実行時に上書き可能
タイプ |
デフォルト |
|
---|---|---|
If DevServices has been explicitly enabled or disabled. DevServices is generally enabled by default, unless there is an existing configuration present. When DevServices is enabled Quarkus will attempt to automatically configure and start a database when running in Dev or Test mode and when Docker is running. Environment variable: |
boolean |
|
Optional fixed port the dev service will listen to. If not defined, the port will be chosen randomly. Environment variable: |
int |
|
Indicates if the Infinispan server managed by Quarkus Dev Services is shared. When shared, Quarkus looks for running containers using label-based service discovery. If a matching container is found, it is used, and so a second one is not started. Otherwise, Dev Services for Infinispan starts a new container.
The discovery uses the Environment variable: |
boolean |
|
The value of the Environment variable: |
string |
|
List of the artifacts to automatically download and add to the Infinispan server libraries. For example a Maven coordinate (org.postgresql:postgresql:42.3.1) or a dependency location url. If an invalid value is passed, the Infinispan server will throw an error when trying to start. Environment variable: |
list of string |
Elasticsearch
Redis Dev Serviceは、アプリケーションに quarkus-redis-client
エクステンションが存在し、サーバー・アドレスが明示的に設定されていない場合に有効になります。詳細は、 Redis Dev Services Guideをご覧ください。
ビルド時に固定される設定プロパティ - その他の設定プロパティはランタイムでオーバーライド可能です。
タイプ |
デフォルト |
|
---|---|---|
If Dev Services for Elasticsearch has been explicitly enabled or disabled. Dev Services are generally enabled by default, unless there is an existing configuration present. For Elasticsearch, Dev Services starts a server unless Environment variable: |
boolean |
|
Optional fixed port the dev service will listen to. If not defined, the port will be chosen randomly. Environment variable: |
int |
|
The Elasticsearch container image to use. Defaults to the elasticsearch image provided by Elastic. Environment variable: |
string |
|
The value for the ES_JAVA_OPTS env variable. Defaults to setting the heap to 1GB. Environment variable: |
string |
|
Indicates if the Elasticsearch server managed by Quarkus Dev Services is shared. When shared, Quarkus looks for running containers using label-based service discovery. If a matching container is found, it is used, and so a second one is not started. Otherwise, Dev Services for Elasticsearch starts a new container.
The discovery uses the Environment variable: |
boolean |
|
The value of the Environment variable: |
string |
|