public final class ConnectionFactoryUtils extends ObjectSE
ConnectionFactory を管理するためのヘルパークラス。特に、特定の ConnectionFactory のトランザクション Rabbit リソースを取得するためのものです。 主にフレームワーク内での内部使用のため。RabbitTemplate および SimpleMessageListenerContainer で使用されます。
| 修飾子と型 | クラスと説明 |
|---|---|
static interface | ConnectionFactoryUtils.ResourceFactory リソース作成用のコールバックインターフェース。 |
| 修飾子と型 | メソッドと説明 |
|---|---|
static RabbitResourceHolder | bindResourceToTransaction(RabbitResourceHolder resourceHolder, ConnectionFactory connectionFactory, boolean synched) |
static Connection | createConnection(ConnectionFactory connectionFactory, boolean publisherConnectionIfPossible) この接続ファクトリおよび / またはそのパブリッシャーファクトリとの接続を作成します。 |
static RabbitResourceHolder | getTransactionalResourceHolder(ConnectionFactory connectionFactory, boolean synchedLocalTransactionAllowed) 現在のトランザクションと同期されている RabbitMQ チャネルを取得します (存在する場合)。 |
static RabbitResourceHolder | getTransactionalResourceHolder(ConnectionFactory connectionFactory, boolean synchedLocalTransactionAllowed, boolean publisherConnectionIfPossible) 現在のトランザクションと同期されている RabbitMQ チャネルを取得します (存在する場合)。 |
static boolean | isChannelTransactional(com.rabbitmq.client.Channel channel, ConnectionFactory connectionFactory) 指定された RabbitMQ チャネルがトランザクション対応であるかどうか、つまり、Spring のトランザクション機能によって現在のスレッドにバインドされているかどうかを判断します。 |
static void | registerDeliveryTag(ConnectionFactory connectionFactory, com.rabbitmq.client.Channel channel, LongSE tag) |
static void | releaseResources(RabbitResourceHolder resourceHolder) |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSEpublic static boolean isChannelTransactional(com.rabbitmq.client.Channel channel,
ConnectionFactory connectionFactory)channel - 確認する RabbitMQ チャネル connectionFactory - Channel の元となった RabbitMQ ConnectionFactorypublic static RabbitResourceHolder getTransactionalResourceHolder(ConnectionFactory connectionFactory, boolean synchedLocalTransactionAllowed)
connectionFactory - チャネルを取得するための ConnectionFactorysynchedLocalTransactionAllowed - Spring 管理のトランザクション (たとえば、メイントランザクションが特定の DataSource 用の JDBC ベースのトランザクションである場合) と同期されるローカル RabbitMQ トランザクションを許可するかどうか。RabbitMQ トランザクションはメイントランザクションの直後にコミットされます。許可されていない場合、指定された ConnectionFactory はカバーでトランザクションの登録を処理する必要があります。null public static RabbitResourceHolder getTransactionalResourceHolder(ConnectionFactory connectionFactory, boolean synchedLocalTransactionAllowed, boolean publisherConnectionIfPossible)
connectionFactory - チャネルを取得するための ConnectionFactorysynchedLocalTransactionAllowed - Spring 管理のトランザクション (たとえば、メイントランザクションが特定の DataSource 用の JDBC ベースのトランザクションである場合) と同期されるローカル RabbitMQ トランザクションを許可するかどうか。RabbitMQ トランザクションはメイントランザクションの直後にコミットされます。許可されていない場合、指定された ConnectionFactory はカバーでトランザクションの登録を処理する必要があります。publisherConnectionIfPossible - 可能であれば、別のパブリッシャー接続から接続を取得します。null public static void releaseResources(@Nullable RabbitResourceHolder resourceHolder)
public static RabbitResourceHolder bindResourceToTransaction(RabbitResourceHolder resourceHolder, ConnectionFactory connectionFactory, boolean synched)
public static void registerDeliveryTag(ConnectionFactory connectionFactory, com.rabbitmq.client.Channel channel, LongSE tag)
public static Connection createConnection(ConnectionFactory connectionFactory, boolean publisherConnectionIfPossible)
connectionFactory - 接続ファクトリ。publisherConnectionIfPossible - パブリッシャーファクトリが存在する場合、それを使用する場合は true。