Class AmqpClientMessageHandlerSpec

All Implemented Interfaces:
DisposableBean, FactoryBean<AmqpClientMessageHandler>, InitializingBean, Lifecycle, Phased, SmartLifecycle

public class AmqpClientMessageHandlerSpec extends MessageHandlerSpec<AmqpClientMessageHandlerSpec, AmqpClientMessageHandler>
Since:
7.0
Author:
Artem Bilan
  • Constructor Details

  • Method Details

    • headerMapper

      public AmqpClientMessageHandlerSpec headerMapper(AmqpHeaderMapper headerMapper)
      Set an AmqpHeaderMapper to map request (and reply) headers.
      Parameters:
      headerMapper - the AmqpHeaderMapper to use.
      Returns:
      the spec
    • messageConverter

      public AmqpClientMessageHandlerSpec messageConverter(MessageConverter messageConverter)
      Set a MessageConverter to replace the default SimpleMessageConverter. If set to null, an AMQP message is sent as is into a message payload. And a reply message has to return an AMQP message as its payload.
      Parameters:
      messageConverter - the MessageConverter to use or null.
      Returns:
      the spec
    • exchange

      public AmqpClientMessageHandlerSpec exchange(String exchange)
      Set an exchange for publishing a request message. Mutually exclusive with queue(String).
      Parameters:
      exchange - the exchange to send a request message.
      Returns:
      the spec
    • exchangeFunction

      public <P> AmqpClientMessageHandlerSpec exchangeFunction(Function<Message<P>, String> exchangeFunction)
      Set a function to determine an exchange for publishing a request message at runtime. Mutually exclusive with queue(String).
      Parameters:
      exchangeFunction - the function to determine an exchange against a request message.
      Returns:
      the spec
    • exchangeExpression

      public AmqpClientMessageHandlerSpec exchangeExpression(Expression exchangeExpression)
      Set a SpEL expression to determine exchange for publishing a request message at runtime. Mutually exclusive with queue(String).
      Parameters:
      exchangeExpression - the SpEL expression to determine an exchange against a request message.
      Returns:
      the spec
    • exchangeExpression

      public AmqpClientMessageHandlerSpec exchangeExpression(String exchangeExpression)
      Set a SpEL expression to determine an exchange for publishing a request message at runtime. Mutually exclusive with queue(String).
      Parameters:
      exchangeExpression - the SpEL expression to determine an exchange against a request message.
      Returns:
      the spec
    • routingKey

      public AmqpClientMessageHandlerSpec routingKey(String routingKey)
      Set a routing key for publishing a request message. Used only together with exchange(String).
      Parameters:
      routingKey - the routing key to send a request message.
      Returns:
      the spec
    • routingKeyFunction

      public <P> AmqpClientMessageHandlerSpec routingKeyFunction(Function<Message<P>, String> routingKeyFunction)
      Set a function to determine routing key for publishing a request message at runtime. Mutually exclusive with queue(String). Used only together with exchange(String).
      Parameters:
      routingKeyFunction - the function to determine a routing key against a request message.
      Returns:
      the spec
    • routingKeyExpression

      public AmqpClientMessageHandlerSpec routingKeyExpression(String routingKeyExpression)
      Set a SpEL expression to determine a routing key for publishing a request message at runtime. Mutually exclusive with queue(String). Used only together with exchange(String).
      Parameters:
      routingKeyExpression - the SpEL expression to determine a routing key against a request message.
      Returns:
      the spec
    • routingKeyExpression

      public AmqpClientMessageHandlerSpec routingKeyExpression(Expression routingKeyExpression)
      Set a SpEL expression to determine routing key for publishing a request message at runtime. Mutually exclusive with queue(String). Used only together with exchange(String).
      Parameters:
      routingKeyExpression - the SpEL expression determine a routing key against a request message.
      Returns:
      the spec
    • queue

      public AmqpClientMessageHandlerSpec queue(String queue)
      Set a queue for publishing a request message. Mutually exclusive with exchange(String).
      Parameters:
      queue - the queue to send a request message.
      Returns:
      the spec
    • queueExpression

      public AmqpClientMessageHandlerSpec queueExpression(String queueExpression)
      Set a SpEL expression to determine a queue for publishing a request message at runtime. Mutually exclusive with exchange(String).
      Parameters:
      queueExpression - the SpEL expression to determine a queue against a request message.
      Returns:
      the spec
    • queueFunction

      public <P> AmqpClientMessageHandlerSpec queueFunction(Function<Message<P>, String> queueFunction)
      Set a function to determine a queue for publishing a request message at runtime. Mutually exclusive with exchange(String).
      Parameters:
      queueFunction - the function to determine a queue against a request message.
      Returns:
      the spec
    • queueExpression

      public AmqpClientMessageHandlerSpec queueExpression(Expression queueExpression)
      Set a SpEL expression to determine a queue for publishing a request message at runtime. Mutually exclusive with exchange(String).
      Parameters:
      queueExpression - the SpEL expression to determine a queue against a request message.
      Returns:
      the spec
    • replyPayloadType

      public AmqpClientMessageHandlerSpec replyPayloadType(Class<?> replyPayloadType)
      Set a reply payload type. Used only in the gateway mode.
      Parameters:
      replyPayloadType - the reply payload type.
      Returns:
      the spec
    • replyPayloadType

      public AmqpClientMessageHandlerSpec replyPayloadType(ResolvableType replyPayloadType)
      Set a reply payload type. Used only in the gateway mode.
      Parameters:
      replyPayloadType - the reply payload type.
      Returns:
      the spec
    • replyPayloadTypeExpression

      public AmqpClientMessageHandlerSpec replyPayloadTypeExpression(String replyPayloadTypeExpression)
      Set a SpEL expression for the reply payload type. Used only in the gateway mode. Must be evaluated to a Class or ResolvableType.
      Parameters:
      replyPayloadTypeExpression - the expression for a reply payload type.
      Returns:
      the spec
    • replyPayloadTypeFunction

      public <P> AmqpClientMessageHandlerSpec replyPayloadTypeFunction(Function<Message<P>, ?> replyPayloadTypeFunction)
      Set a function for the reply payload type. Used only in the gateway mode. Must be evaluated to a Class or ResolvableType.
      Parameters:
      replyPayloadTypeFunction - the expression for a reply payload type.
      Returns:
      the spec
    • replyPayloadTypeExpression

      public AmqpClientMessageHandlerSpec replyPayloadTypeExpression(Expression replyPayloadTypeExpression)
      Set a SpEL expression for the reply payload type. Used only in the gateway mode. Must be evaluated to a Class or ResolvableType.
      Parameters:
      replyPayloadTypeExpression - the expression for a reply payload type.
      Returns:
      the spec
    • returnMessage

      public AmqpClientMessageHandlerSpec returnMessage(boolean returnMessage)
      Set to true to return the reply as a whole AMQP message. Used only in the gateway mode.
      Parameters:
      returnMessage - true to return the reply as a whole AMQP message.
      Returns:
      the spec