Class BoundRabbitChannelAdvice

java.lang.Object
org.springframework.integration.amqp.support.BoundRabbitChannelAdvice
All Implemented Interfaces:
org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor, org.springframework.integration.handler.advice.HandleMessageAdvice

public class BoundRabbitChannelAdvice
extends java.lang.Object
implements org.springframework.integration.handler.advice.HandleMessageAdvice
An advice that causes all downstream RabbitOperations operations to be executed on the same channel, as long as there are no thread handoffs, since the channel is bound to the thread. The same RabbitOperations must be used in this and all downstream components. Typically, used with a splitter or some other mechanism that would cause multiple messages to be sent. Optionally waits for publisher confirms if the channel is so configured.
Since:
5.1
  • Constructor Summary

    Constructors 
    Constructor Description
    BoundRabbitChannelAdvice​(org.springframework.amqp.rabbit.core.RabbitOperations operations)
    Construct an instance that doesn't wait for confirms.
    BoundRabbitChannelAdvice​(org.springframework.amqp.rabbit.core.RabbitOperations operations, java.time.Duration waitForConfirmsTimeout)
    Construct an instance that waits for publisher confirms (if configured and waitForConfirmsTimeout is not null).
  • Method Summary

    Modifier and Type Method Description
    java.lang.Object invoke​(org.aopalliance.intercept.MethodInvocation invocation)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BoundRabbitChannelAdvice

      public BoundRabbitChannelAdvice​(org.springframework.amqp.rabbit.core.RabbitOperations operations)
      Construct an instance that doesn't wait for confirms.
      Parameters:
      operations - the operations.
    • BoundRabbitChannelAdvice

      public BoundRabbitChannelAdvice​(org.springframework.amqp.rabbit.core.RabbitOperations operations, @Nullable java.time.Duration waitForConfirmsTimeout)
      Construct an instance that waits for publisher confirms (if configured and waitForConfirmsTimeout is not null).
      Parameters:
      operations - the operations.
      waitForConfirmsTimeout - the timeout.
  • Method Details

    • invoke

      public java.lang.Object invoke​(org.aopalliance.intercept.MethodInvocation invocation) throws java.lang.Throwable
      Specified by:
      invoke in interface org.aopalliance.intercept.MethodInterceptor
      Throws:
      java.lang.Throwable