クラス RabbitResourceHolder

java.lang.ObjectSE
org.springframework.transaction.support.ResourceHolderSupport
org.springframework.amqp.rabbit.connection.RabbitResourceHolder
実装されているすべてのインターフェース:
ResourceHolder

public class RabbitResourceHolder extends ResourceHolderSupport
RabbitMQ 接続とチャネルをラップする Rabbit リソースホルダー。RabbitTransactionManager は、指定された Rabbit ConnectionFactory に対して、このクラスのインスタンスをスレッドにバインドします。

メモ: これは SPI クラスであり、アプリケーションでの使用は意図されていません。

作成者:
Mark Fisher, Dave Syer, Gary Russell, Ngoc Nhan
関連事項:
  • コンストラクターの詳細

    • RabbitResourceHolder

      public RabbitResourceHolder()
      リソースを追加するために開いている新しい RabbitResourceHolder を作成します。
    • RabbitResourceHolder

      public RabbitResourceHolder(com.rabbitmq.client.Channel channel, boolean releaseAfterCompletion)
      チャネルのインスタンスを構築します。
      パラメーター:
      channel - 追加するチャンネル
      releaseAfterCompletion - 完了後にチャネルを解放する必要がある場合は true。
  • メソッドの詳細

    • isReleaseAfterCompletion

      public boolean isReleaseAfterCompletion()
      トランザクションの完了後にリソースを解放するかどうか。デフォルトは真です。リスナーは引き続きチャネルを使用するため、リスナーコンテナーは false に設定されます。
      戻り値:
      リソースを解放する必要がある場合は true。
    • setRequeueOnRollback

      public void setRequeueOnRollback(boolean requeueOnRollback)
      ロールバック時にメッセージを再キューイングするには true に設定します。デフォルトは真です。
      パラメーター:
      requeueOnRollback - 再キューイングに真
      導入:
      1.7.1
    • addConnection

      public final void addConnection(Connection connection)
    • addChannel

      public final void addChannel(com.rabbitmq.client.Channel channel)
    • addChannel

      public final void addChannel(com.rabbitmq.client.Channel channel, @Nullable Connection connection)
    • containsChannel

      public boolean containsChannel(com.rabbitmq.client.Channel channel)
    • getConnection

      public @Nullable Connection getConnection()
    • getChannel

      public @Nullable com.rabbitmq.client.Channel getChannel()
    • commitAll

      public void commitAll() throws AmqpException
      例外:
      AmqpException
    • closeAll

      public void closeAll()
    • addDeliveryTag

      public void addDeliveryTag(com.rabbitmq.client.Channel channel, long deliveryTag)
    • rollbackAll

      public void rollbackAll()