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

LRA 用 Dev Services

Narayana LRA エクステンション (quarkus-narayana-lra) が存在する場合、Narayana LRA コーディネーター 用 Dev Services は、開発モードおよびテスト実行時に Narayana LRA コーディネーターを自動的に起動します。そのため、手動で起動する必要はありません。アプリケーションも、コーディネーターに接続し、コーディネーターがアプリケーションにコールバックできるように自動的に設定されます。

LRA コーディネーターはコンテナーからアプリケーションにコールバックする必要があるため、アプリケーションを localhost だけでなく、任意のホストアドレスで公開する必要があります。そのため、LRA コーディネーター 用 Dev Services は、アプリケーション設定に quarkus.http.host=0.0.0.0 を注入します。これは、開発マシンと同じネットワークで実行されているどのマシンからもアプリケーションにアクセスできることを意味します。これは潜在的なセキュリティリスクです。そのため、LRA Dev Services は、安全であると確信できる場合にのみ使用してください。

LRA 用 Dev Services の有効化/無効化

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

  • quarkus.lra.devservices.enabledfalse に設定されている

  • quarkus.lra.coordinator-url が設定されている

LRA 用 Dev Services は、コーディネーターを起動するために Docker または Podman に依存します。お使いの環境が Docker をサポートしていない場合は、コーディネーターを手動で起動するか、既に実行中のコーディネーターに接続する必要があります。quarkus.lra.coordinator-url を使用して、コーディネーターの URL を設定できます。

LRA コーディネーターの共有

ほとんどの場合、アプリケーション間で LRA コーディネーターを共有する必要があります。LRA コーディネーター 用 Dev Services は、開発モード で動作する複数の Quarkus アプリケーションが単一のコーディネーターを共有するための サービスディスカバリー メカニズムを実装しています。

LRA 用 Dev Services は、コンテナーを識別するために使用される quarkus-dev-service-lra-coordinator ラベルを付けてコンテナーを起動します。

複数の(共有)コーディネーターが必要な場合は、quarkus.lra.devservices.service-name 属性を設定し、コーディネーター名を指定できます。同じ値を持つコンテナーを探し、見つからない場合は新しいコンテナーを起動します。デフォルトのサービス名は lra-coordinator です。

共有は開発モードではデフォルトで有効ですが、テストモードでは無効です。quarkus.lra.devservices.shared=false で共有を無効にできます。

ポートの設定

デフォルトでは、LRA 用 Dev Services は LRA コーディネーターを実行するランダムなポートを選択します。quarkus.lra.devservices.port 設定プロパティーを設定することでポートを設定できます。接続設定プロパティー quarkus.lra.coordinator-url は、選択されたポートで自動的に設定されます。

イメージの設定

LRA コーディネーターのデフォルトイメージは quay.io/jbosstm/lra-coordinator です。quarkus.lra.devservices.image-name 設定プロパティーを使用して、LRA コーディネーター 用 Dev Services が使用するイメージを設定できます。利用可能なイメージは https://quay.io/repository/jbosstm/lra-coordinator?tab=tags で参照できます。

Compose

LRA Dev Services は Compose Dev Services をサポートしています。これは compose-devservices.yml に依存します。例:

name: <application name>
services:
  narayana-lra:
    image: quay.io/jbosstm/lra-coordinator:latest
    ports:
      - "8080"

設定リファレンス

ビルド時に固定される設定プロパティ - それ以外の設定プロパティは実行時に上書き可能

Configuration property

タイプ

デフォルト

If Dev Services for the LRA coordinator has been explicitly enabled or disabled. For the LRA coordinator, the Dev Services is disabled if this property is false or if the quarkus.lra.coordinator-url configuration property is defined.

Environment variable: QUARKUS_LRA_DEVSERVICES_ENABLED

Show more

boolean

true

Optional fixed port the Dev Services will listen to.

If not defined, the port will be chosen randomly.

Environment variable: QUARKUS_LRA_DEVSERVICES_PORT

Show more

int

Optional override of the LRA coordinator container image to use.

Environment variable: QUARKUS_LRA_DEVSERVICES_IMAGE_NAME

Show more

string

quay.io/jbosstm/lra-coordinator:latest

Indicates if the LRA coordinator 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 LRA coordinator starts a new container.

The discovery uses the quarkus-dev-service-lra-coordinator label. The value is configured using the service-name property.

Container sharing is only used in dev mode.

Environment variable: QUARKUS_LRA_DEVSERVICES_SHARED

Show more

boolean

true

The value of the quarkus-dev-service-lra-coordinator 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 LRA coordinator looks for a container with the quarkus-dev-service-lra-coordinator 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-lra-coordinator label set to the specified value.

This property is used when you need multiple shared LRA coordinators.

Environment variable: QUARKUS_LRA_DEVSERVICES_SERVICE_NAME

Show more

string

lra-coordinator

Environment variables that are passed to the container.

Environment variable: QUARKUS_LRA_DEVSERVICES_CONTAINER_ENV__ENVIRONMENT_VARIABLE_NAME_

Show more

Map<String,String>

Whether to log the warning messages about the LRA Dev Services.

Defaults to true.

Environment variable: QUARKUS_LRA_DEVSERVICES_LOG_WARNING

Show more

boolean

true

関連コンテンツ