306.3. Spring Boot Auto-Configuration

コンポーネントは、以下に記載される 15 のオプションをサポートします。

名前説明デフォルトタイプ

camel.component.sjms.connection-client-id

デフォルトの org.apache.camel.component.sjms.jms.ConnectionFactoryResource を使用するときに javax.jms.Connection を作成するときに使用するクライアント ID。

 

String

camel.component.sjms.connection-count

このコンポーネントで開始されたエンドポイントで使用可能な接続の最大数。

1

Integer

camel.component.sjms.connection-factory

SjmsComponent を有効にするには、ConnectionFactory が必要です。直接設定することも、ConnectionResource の一部として設定することもできます。オプションは javax.jms.ConnectionFactory タイプです。

 

String

camel.component.sjms.connection-max-wait

デフォルトの org.apache.camel.component.sjms.jms.ConnectionFactoryResource を使用する場合に、プールが使い果たされたときにブロックして空き接続を待機する最大待機時間 (ミリ単位)。

5000

Long

camel.component.sjms.connection-password

デフォルトの org.apache.camel.component.sjms.jms.ConnectionFactoryResource を使用するときに javax.jms.Connection を作成するときに使用するパスワード。

 

String

camel.component.sjms.connection-resource

ConnectionResource は、ConnectionFactory のカスタマイズとコンテナー制御を可能にするインターフェイスです。詳細については、プラグ可能な接続リソースの管理を参照してください。オプションは org.apache.camel.component.sjms.jms.ConnectionResource タイプです。

 

String

camel.component.sjms.connection-test-on-borrow

デフォルトの org.apache.camel.component.sjms.jms.ConnectionFactoryResource を使用する場合、プールから返される前に各 javax.jms.Connection をテストする (start を呼び出す) 必要があります。

true

Boolean

camel.component.sjms.connection-username

デフォルトの org.apache.camel.component.sjms.jms.ConnectionFactoryResource を使用するときに javax.jms.Connection を作成するときに使用するユーザー名。

 

String

camel.component.sjms.destination-creation-strategy

カスタム DestinationCreationStrategy を使用する場合。オプションは org.apache.camel.component.sjms.jms.DestinationCreationStrategy タイプです。

 

String

camel.component.sjms.enabled

sjms コンポーネントを有効にします。

true

Boolean

camel.component.sjms.header-filter-strategy

カスタムの org.apache.camel.spi.HeaderFilterStrategy を使用して、Camel メッセージとの間でヘッダーをフィルターします。このオプションは org.apache.camel.spi.HeaderFilterStrategy タイプです。

 

String

camel.component.sjms.jms-key-format-strategy

JMS 仕様に準拠できるように、JMS キーをエンコードおよびデコードするためのプラグ可能な戦略。Camel はすぐに使用できる 1 つの実装を提供します: デフォルトです。デフォルトのストラテジーでは、ドットとハイフン(. および -)を安全にマーシャリングします。JMS ヘッダーキーに不正な文字が含まれているかどうかは問題にならない JMS ブローカーに使用できます。org.apache.camel.component.jms.JmsKeyFormatStrategy の独自の実装を提供し、# 表記を使用して参照できます。オプションは org.apache.camel.component.sjms.jms.JmsKeyFormatStrategy タイプです。

 

String

camel.component.sjms.message-created-strategy

Camel が JMS メッセージを送信しているときに、Camel が javax.jms.Message オブジェクトの新しいインスタンスを作成するときに呼び出される、指定された MessageCreatedStrategy を使用します。オプションは org.apache.camel.component.sjms.jms.MessageCreatedStrategy タイプです。

 

String

camel.component.sjms.resolve-property-placeholders

起動時にコンポーネントがプロパティープレースホルダーを解決するかどうか。String タイプのプロパティーのみがプロパティープレースホルダーを使用できます。

true

Boolean

camel.component.sjms.transaction-commit-strategy

使用するコミットストラテジーの種類を設定する場合。Camel は、追加設定なしで、default と batch の 2 つの実装を提供します。オプションは org.apache.camel.component.sjms.TransactionCommitStrategy タイプです。

 

String

以下は、必要な ConnectionFactory プロバイダーを使用して SjmsComponent を設定する方法の例です。デフォルトで単一の接続を作成し、コンポーネントの内部プーリング API を使用してそれを保存し、スレッドセーフな方法でセッション作成リクエストを処理できるようにします。

SjmsComponent component = new SjmsComponent();
component.setConnectionFactory(new ActiveMQConnectionFactory("tcp://localhost:61616"));
getContext().addComponent("sjms", component);

永続的なサブスクリプションをサポートするために必要な SJMS コンポーネントの場合、デフォルトの ConnectionFactoryResource インスタンスをオーバーライドして clientId プロパティーを設定できます。

ConnectionFactoryResource connectionResource = new ConnectionFactoryResource();
connectionResource.setConnectionFactory(new ActiveMQConnectionFactory("tcp://localhost:61616"));
connectionResource.setClientId("myclient-id");

SjmsComponent component = new SjmsComponent();
component.setConnectionResource(connectionResource);
component.setMaxConnections(1);