Class AmqpClientMessageHandlerSpec

java.lang.Object
org.springframework.integration.dsl.IntegrationComponentSpec<AmqpClientMessageHandlerSpec, AmqpClientMessageHandler>
org.springframework.integration.dsl.MessageHandlerSpec<AmqpClientMessageHandlerSpec, AmqpClientMessageHandler>
org.springframework.integration.amqp.dsl.AmqpClientMessageHandlerSpec
All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<AmqpClientMessageHandler>, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle

public class AmqpClientMessageHandlerSpec extends org.springframework.integration.dsl.MessageHandlerSpec<AmqpClientMessageHandlerSpec, AmqpClientMessageHandler>
Since:
7.0
  • Constructor Details

    • AmqpClientMessageHandlerSpec

      public AmqpClientMessageHandlerSpec(org.springframework.amqp.core.AsyncAmqpTemplate amqpTemplate)
      Construct an instance with the provided AsyncAmqpTemplate. The AsyncAmqpTemplate must be an implementation for AMQP 1.0 protocol, e.g. RabbitAmqpTemplate.
      Parameters:
      amqpTemplate - the AsyncAmqpTemplate to use.
  • 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(org.springframework.amqp.support.converter.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<org.springframework.messaging.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(org.springframework.expression.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<org.springframework.messaging.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(org.springframework.expression.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<org.springframework.messaging.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(org.springframework.expression.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(org.springframework.core.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<org.springframework.messaging.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(org.springframework.expression.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