9.6. Spring Boot 自動設定
Spring Boot で azure-servicebus を使用する場合は、次の Maven 依存関係を使用して自動設定をサポートしてください。
<dependency> <groupId>org.apache.camel.springboot</groupId> <artifactId>camel-azure-servicebus-starter</artifactId> </dependency>
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-azure-servicebus-starter</artifactId>
</dependency>
コンポーネントは、以下に記載される 26 個のオプションをサポートします。
| 名前 | 説明 | デフォルト | タイプ |
|---|---|---|---|
| camel.component.azure-servicebus.amqp-retry-options | Service Bus クライアントの再試行オプションを設定します。指定しないと、デフォルトの再試行オプションが使用されます。オプションは com.azure.core.amqp.AmqpRetryOptions 型です。 | AmqpRetryOptions | |
| camel.component.azure-servicebus.amqp-transport-type | Azure Service Bus とのすべての通信が発生するトランスポートの種類を設定します。デフォルト値は AmqpTransportType#AMQP です。 | AmqpTransportType | |
| camel.component.azure-servicebus.autowired-enabled | 自動ワイヤリングが有効になっているかどうか。これは、コンポーネントで設定される一致するタイプのインスタンスが 1 つあるかどうかを検出するためにレジストリーを検索することで、自動ワイアリングオプションに使用されます (オプションは自動ワイアとマーク付けされる必要があります)。これは、JDBC データソース、JMS 接続ファクトリー、AWS クライアントなどの自動設定に使用できます。 | true | Boolean |
| camel.component.azure-servicebus.bridge-error-handler | コンシューマーの Camel ルーティングエラーハンドラーへのブリッジを許可します。よって、コンシューマーが受信メッセージなどの取得を試行している間に発生した例外は、メッセージとして処理され、ルーティングエラーハンドラーによって処理されます。デフォルトでは、consumer は org.apache.camel.spi.ExceptionHandler を使用して例外に対応し、WARN または ERROR レベルでログに記録され、無視されます。 | false | Boolean |
| camel.component.azure-servicebus.client-options | このビルダーから構築されたクライアントから送信される ClientOptions を設定し、特定のプロパティーのカスタマイズを有効にし、カスタムヘッダー情報の追加をサポートします。詳細は、ClientOptions のドキュメントを参照してください。オプションは com.azure.core.util.ClientOptions 型です。 | ClientOptions | |
| camel.component.azure-servicebus.configuration | コンポーネントの設定。オプションは org.apache.camel.component.azure.servicebus.ServiceBusConfiguration タイプです。 | ServiceBusConfiguration | |
| camel.component.azure-servicebus.connection-string | Service Bus 名前空間または特定の Service Bus リソースの接続文字列を設定します。 | String | |
| camel.component.azure-servicebus.consumer-operation | consumer で使用する目的の操作を設定します。 | ServiceBusConsumerOperationDefinition | |
| camel.component.azure-servicebus.disable-auto-complete | 受信メッセージのオートコンプリートと自動破棄を無効にします。デフォルトでは、正常に処理されたメッセージは \\{link ServiceBusReceiverAsyncClient#complete (ServiceBusReceivedMessage) completed} です。メッセージの処理時にエラーが発生した場合は、\\{link ServiceBusReceiverAsyncClient#abandon(ServiceBusReceivedMessage) abandoned} 放棄} です。 | false | Boolean |
| camel.component.azure-servicebus.enabled | azure-servicebus コンポーネントの自動設定を有効にするかどうか。これはデフォルトで有効になっています。 | Boolean | |
| camel.component.azure-servicebus.fully-qualified-namespace | サービスバスの完全修飾名前空間。 | String | |
| camel.component.azure-servicebus.lazy-start-producer | 最初のメッセージでプロデューサーをレイジーに起動すべきかどうか。レイジーに起動することで、起動時に producer が失敗し、それによりルートが失敗する可能性がある状況で、CamelContext およびルートの起動を許可します。レイジーな起動を延期すると、Camel のルーティングエラーハンドラー経由でメッセージのルーティング中に起動の失敗を処理できます。最初のメッセージが処理されるときに、producer の作成および起動に若干時間がかかり、合計処理時間が長くなる可能性があることに注意してください。 | false | Boolean |
| camel.component.azure-servicebus.max-auto-lock-renew-duration | ロックの自動更新を継続する時間を設定します。Duration#ZERO または null を設定すると、自動更新が無効になります。\\{link ServiceBusReceiveMode#RECEIVE_AND_DELETE RECEIVE_AND_DELETE} モードでは、自動更新は無効になっています。オプションは java.time.Duration タイプです。 | 期間 | |
| camel.component.azure-servicebus.peek-num-max-messages | ピーク操作中にピークされるメッセージの最大数を設定します。 | Integer | |
| camel.component.azure-servicebus.prefetch-count | レシーバーのプリフェッチカウントを設定します。\\{link ServiceBusReceiveMode#PEEK_LOCK PEEK_LOCK} モードと \\{link ServiceBusReceiveMode#RECEIVE_AND_DELETE RECEIVE_AND_DELETE} モードの両方で、デフォルト値は 1 です。プリフェッチは、アプリケーションが ServiceBusReceiverAsyncClient#receiveMessages () を使用して要求する前に、ローカルでメッセージをすぐに取得できるようにすることで、メッセージフローを高速化します。ゼロ以外の値を設定すると、その数のメッセージがプリフェッチされます。値をゼロに設定すると、プリフェッチがオフになります。 | Integer | |
| camel.component.azure-servicebus.producer-operation | producer で使用する目的の操作を設定します。 | ServiceBusProducerOperationDefinition | |
| camel.component.azure-servicebus.proxy-options | ServiceBusSenderAsyncClient に使用するプロキシー設定を設定します。プロキシーが設定されている場合は、AmqpTransportType#AMQP_WEB_SOCKETS をトランスポートタイプに使用する必要があります。オプションは com.azure.core.amqp.ProxyOptions 型です。 | ProxyOptions | |
| camel.component.azure-servicebus.receiver-async-client | consumer がメッセージを消費するために、receiverAsyncClient を設定します。オプションは com.azure.messaging.servicebus.ServiceBusReceiverAsyncClient 型です。 | ServiceBusReceiverAsyncClient | |
| camel.component.azure-servicebus.scheduled-enqueue-time | メッセージが Service Bus キューまたはトピックに表示される OffsetDateTime を設定します。オプションは java.time.OffsetDateTime 型です。 | OffsetDateTime | |
| camel.component.azure-servicebus.sender-async-client | producer で使用される SenderAsyncClient を設定します。オプションは com.azure.messaging.servicebus.ServiceBusSenderAsyncClient 型です。 | ServiceBusSenderAsyncClient | |
| camel.component.azure-servicebus.service-bus-receive-mode | 受信機の受信モードを設定します。 | ServiceBusReceiveMode | |
| camel.component.azure-servicebus.service-bus-transaction-context | サービス中のトランザクションを表します。このオブジェクトにはトランザクション ID のみが含まれます。オプションは com.azure.messaging.servicebus.ServiceBusTransactionContext 型です。 | ServiceBusTransactionContext | |
| camel.component.azure-servicebus.service-bus-type | 実行するサービスバスの接続の種類。キューは、サブスクリプションベースのモデルの典型的なキューオプションとトピックです。 | ServiceBusType | |
| camel.component.azure-servicebus.sub-queue | 接続先の SubQueue のタイプを設定します。 | SubQueue | |
| camel.component.azure-servicebus.subscription-name | リッスンするトピックのサブスクリプションの名前を設定します。topicOrQueueName および serviceBusType=topic も設定する必要があります。このプロパティーは、serviceBusType=topic であり、consumer が使用されている場合に必要です。 | String | |
| camel.component.azure-servicebus.token-credential | com.azure.identity に実装されている、Azure AD 認証用の TokenCredential。オプションは com.azure.core.credential.TokenCredential 型です。 | TokenCredential |