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

Dev Services for Apicurio Registry

If an extension for schema registry, such as quarkus-apicurio-registry-avro or quarkus-confluent-registry-avro, is present, Dev Services for Apicurio Registry automatically starts an Apicurio Registry instance in dev mode and when running tests. Also, all Kafka channels in SmallRye Reactive Messaging are automatically configured to use this registry. This automatic configuration only applies to serializers and deserializers from Apicurio Registry serde libraries and Confluent Schema Registry serde libraries, because their properties are set:

# for Apicurio Registry serde
mp.messaging.connector.smallrye-kafka.apicurio.registry.url=http://localhost:8081/apis/registry/v2
# for Confluent Schema Registry serde
mp.messaging.connector.smallrye-kafka.schema.registry.url=http://localhost:8081/apis/ccompat/v6

Dev Services for Apicurio Registryの有効化/無効化

Dev Services for Apicurio Registryは以下に当てはまらない場合、自動的に有効になります。

  • quarkus.apicurio-registry.devservices.enabledfalse に設定されていること

  • mp.messaging.connector.smallrye-kafka.apicurio.registry.url が設定されていること

  • mp.messaging.connector.smallrye-kafka.schema.registry.url が設定されていること

  • すべてのReactive Messaging Kafkaチャンネルには apicurio.registry.url 属性か、 schema.registry.url 属性が設定されています

Dev Services for Apicurio Registryは、レジストリの起動にDockerを使用しています。お使いの環境がDockerをサポートしていない場合は、レジストリを手動で起動するか、すでに稼働しているレジストリを使用する必要があります。そのような場合、単一のプロパティを使用して、SmallRye Reactive Messaging のすべての Kafka チャネルのレジストリ URL を構成できます。 Apicurio Registry serde の場合は以下です。

mp.messaging.connector.smallrye-kafka.apicurio.registry.url=... your Apicurio Registry URL...

Confluent Schema Registry serdeについては、以下です。

mp.messaging.connector.smallrye-kafka.schema.registry.url=... your Confluent Schema Registry URL...

共有レジストリ

Most of the time, you need to share the registry between applications. Dev Services for Apicurio Registry implements a service discovery mechanism for your multiple Quarkus applications running in dev mode to share a single registry.

Dev Services for Apicurio Registry starts the container with the quarkus-dev-service-apicurio-registry label, which is used to identify the container.

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

共有は、開発モードではデフォルトで有効ですが、testモードでは無効です。 quarkus.apicurio-registry.devservices.shared=false で共有を無効にすることが可能です。

ポートの設定

既定では、Dev Services for Apicurio Registryはランダムなポートを選択してアプリケーションを設定します。 quarkus.apicurio-registry.devservices.port プロパティを設定することで、ポートを設定できます。

SmallRye Reactive messaging のKafkaチャンネルは、選択したポートで自動的に設定されることに注意してください。

イメージの設定

Dev Services for Apicurio Registryは、 apicurio/apicurio-registry-mem のイメージを使用しています。 https://hub.docker.com/r/apicurio/apicurio-registry-mem から任意の 2.x バージョンを選択することができます。

quarkus.apicurio-registry.devservices.image-name=quay.io/apicurio/apicurio-registry-mem:2.6.13.Final

Compose

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

name: <application name>
services:
  apicurio:
    image: quay.io/apicurio/apicurio-registry-mem:2.6.13.Final
    ports:
      - "8080"

関連コンテンツ