The English version of quarkus.io is the official project site. Translated sites are community supported on a best-effort basis.
このページを編集

Dev Services for AMQP

Dev Services for AMQP は、開発モードやテストの実行時に AMQP 1.0 ブローカーを自動的に起動します。そのため、ブローカーを手動で起動する必要はありません。アプリケーションは自動的に構成されます。

Dev Services for AMQPの有効化/無効化

以下の場合を除き、Dev Services for AMQPは自動的に有効になります。

  • quarkus.amqp.devservices.enabledfalse に設定されている場合

  • amqp-host または amqp-port が設定されている場合

  • すべてのReactive Messaging AMQPチャンネルに host または port の属性が設定されている場合

Dev Services for AMQPでは、ブローカーの起動にDockerを使用しています。お使いの環境でDockerがサポートされていない場合は、ブローカーを手動で起動するか、すでに稼働しているブローカーに接続する必要があります。ブローカーのアクセスは、 amqp-hostamqp-portamqp-useramqp-password プロパティを使用して構成できます。

共有ブローカー

ほとんどの場合、アプリケーション間でブローカーを共有する必要があります。Dev Services for AMQPは、 dev モードで動作する複数のQuarkusアプリケーションが1つのブローカーを共有するための サービスディスカバリー メカニズムを実装しています。

Dev Services for AMQP は、コンテナを識別するために使用される quarkus-dev-service-amqp ラベルでコンテナを開始します。

複数の(共有)ブローカーが必要な場合は、 quarkus.amqp.devservices.service-name 属性を設定し、ブローカー名を示します。同じ値のコンテナを探し、見つからない場合は新しいコンテナを開始します。デフォルトのサービス名は amqp です。

共有は、devモードではデフォルトで有効ですが、testモードでは無効です。 quarkus.amqp.devservices.shared=false で共有を無効にすることが出来ます。

ポートの設定

既定では、Dev Services for AMQP はランダムなポートを選択し、アプリケーションを構成します。ポートを設定するには、 quarkus.amqp.devservices.port プロパティを構成します。

イメージの設定

Dev Services for AMQPでは、 activemq-artemis-brokerイメージを使用しています。 quarkus.amqp.devservices.image-name プロパティを使用して、イメージとバージョンを設定できます。

quarkus.amqp.devservices.image-name=quay.io/artemiscloud/activemq-artemis-broker:latest
設定されたイメージは、 activemq-artemis-broker のものと 互換性が なければなりません。 コンテナは、 AMQ_USERAMQ_PASSWORDAMQ_EXTRA_ARGS の環境変数で起動します。 ポート 5672 と 8161(ウェブ・コンソール)が公開されます。

設定リファレンス

ビルド時に固定される設定プロパティ - その他の設定プロパティは実行時にオーバーライド可能です。

Configuration property

タイプ

デフォルト

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 amqp-host or amqp-port are set or if all the Reactive Messaging AMQP channel are configured with host or port.

Environment variable: QUARKUS_AMQP_DEVSERVICES_ENABLED

Show more

ブーリアン

Optional fixed port the dev service will listen to.

If not defined, the port will be chosen randomly.

Environment variable: QUARKUS_AMQP_DEVSERVICES_PORT

Show more

int

The image to use. Note that only ActiveMQ Artemis images are supported. Specifically, the image repository must end with artemiscloud/activemq-artemis-broker.

Check the activemq-artemis-broker on Quay page to find the available versions.

Environment variable: QUARKUS_AMQP_DEVSERVICES_IMAGE_NAME

Show more

string

quay.io/artemiscloud/activemq-artemis-broker:1.0.25

The value of the AMQ_EXTRA_ARGS environment variable to pass to the container. For ActiveMQ Artemis Broker ⇐ 1.0.21, set this property to --no-autotune --mapped --no-fsync --relax-jolokia --http-host 0.0.0.0

Environment variable: QUARKUS_AMQP_DEVSERVICES_EXTRA_ARGS

Show more

string

--no-autotune --mapped --no-fsync --relax-jolokia

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 quarkus-dev-service-amqp label. The value is configured using the service-name property.

Container sharing is only used in dev mode.

Environment variable: QUARKUS_AMQP_DEVSERVICES_SHARED

Show more

ブーリアン

true

The value of the quarkus-dev-service-aqmp label attached to the started container. This property is used when shared is set to true. In this case, before starting a container, Dev Services for AMQP looks for a container with the quarkus-dev-service-amqp label set to the configured value. If found, it will use this container instead of starting a new one. Otherwise, it starts a new container with the quarkus-dev-service-amqp label set to the specified value.

This property is used when you need multiple shared AMQP brokers.

Environment variable: QUARKUS_AMQP_DEVSERVICES_SERVICE_NAME

Show more

string

amqp

Environment variables that are passed to the container.

Environment variable: QUARKUS_AMQP_DEVSERVICES_CONTAINER_ENV__ENVIRONMENT_VARIABLE_NAME_

Show more

Map<String,String>

関連コンテンツ