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:
DisposableBean,FactoryBean<AmqpClientMessageHandler>,InitializingBean,Lifecycle,Phased,SmartLifecycle
public class AmqpClientMessageHandlerSpec
extends MessageHandlerSpec<AmqpClientMessageHandlerSpec, AmqpClientMessageHandler>
Spec for an
AmqpClientMessageHandler.- Since:
- 7.0
- Author:
- Artem Bilan
-
Field Summary
Fields inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
logger, PARSER, targetFields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTEFields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
ConstructorsConstructorDescriptionAmqpClientMessageHandlerSpec(AsyncAmqpTemplate amqpTemplate) Construct an instance with the providedAsyncAmqpTemplate. -
Method Summary
Modifier and TypeMethodDescriptionSet an exchange for publishing a request message.exchangeExpression(String exchangeExpression) Set a SpEL expression to determine an exchange for publishing a request message at runtime.exchangeExpression(Expression exchangeExpression) Set a SpEL expression to determine exchange for publishing a request message at runtime.exchangeFunction(Function<Message<P>, String> exchangeFunction) Set a function to determine an exchange for publishing a request message at runtime.headerMapper(AmqpHeaderMapper headerMapper) Set anAmqpHeaderMapperto map request (and reply) headers.messageConverter(MessageConverter messageConverter) Set aMessageConverterto replace the defaultSimpleMessageConverter.Set a queue for publishing a request message.queueExpression(String queueExpression) Set a SpEL expression to determine a queue for publishing a request message at runtime.queueExpression(Expression queueExpression) Set a SpEL expression to determine a queue for publishing a request message at runtime.queueFunction(Function<Message<P>, String> queueFunction) Set a function to determine a queue for publishing a request message at runtime.replyPayloadType(Class<?> replyPayloadType) Set a reply payload type.replyPayloadType(ResolvableType replyPayloadType) Set a reply payload type.replyPayloadTypeExpression(String replyPayloadTypeExpression) Set a SpEL expression for the reply payload type.replyPayloadTypeExpression(Expression replyPayloadTypeExpression) Set a SpEL expression for the reply payload type.replyPayloadTypeFunction(Function<Message<P>, ?> replyPayloadTypeFunction) Set a function for the reply payload type.returnMessage(boolean returnMessage) Set to true to return the reply as a whole AMQP message.routingKey(String routingKey) Set a routing key for publishing a request message.routingKeyExpression(String routingKeyExpression) Set a SpEL expression to determine a routing key for publishing a request message at runtime.routingKeyExpression(Expression routingKeyExpression) Set a SpEL expression to determine routing key for publishing a request message at runtime.routingKeyFunction(Function<Message<P>, String> routingKeyFunction) Set a function to determine routing key for publishing a request message at runtime.Methods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
_this, afterPropertiesSet, destroy, doGet, getId, getObject, getObjectType, getPhase, id, isAutoStartup, isRunning, start, stop, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.beans.factory.FactoryBean
isSingletonMethods inherited from interface org.springframework.context.SmartLifecycle
isPauseable
-
Constructor Details
-
AmqpClientMessageHandlerSpec
Construct an instance with the providedAsyncAmqpTemplate. TheAsyncAmqpTemplatemust be an implementation for AMQP 1.0 protocol, e.g.RabbitAmqpTemplate.- Parameters:
amqpTemplate- theAsyncAmqpTemplateto use.
-
-
Method Details
-
headerMapper
Set anAmqpHeaderMapperto map request (and reply) headers.- Parameters:
headerMapper- theAmqpHeaderMapperto use.- Returns:
- the spec
-
messageConverter
Set aMessageConverterto replace the defaultSimpleMessageConverter. 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- theMessageConverterto use or null.- Returns:
- the spec
-
exchange
Set an exchange for publishing a request message. Mutually exclusive withqueue(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 withqueue(String).- Parameters:
exchangeFunction- the function to determine an exchange against a request message.- Returns:
- the spec
-
exchangeExpression
Set a SpEL expression to determine exchange for publishing a request message at runtime. Mutually exclusive withqueue(String).- Parameters:
exchangeExpression- the SpEL expression to determine an exchange against a request message.- Returns:
- the spec
-
exchangeExpression
Set a SpEL expression to determine an exchange for publishing a request message at runtime. Mutually exclusive withqueue(String).- Parameters:
exchangeExpression- the SpEL expression to determine an exchange against a request message.- Returns:
- the spec
-
routingKey
Set a routing key for publishing a request message. Used only together withexchange(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 withqueue(String). Used only together withexchange(String).- Parameters:
routingKeyFunction- the function to determine a routing key against a request message.- Returns:
- the spec
-
routingKeyExpression
Set a SpEL expression to determine a routing key for publishing a request message at runtime. Mutually exclusive withqueue(String). Used only together withexchange(String).- Parameters:
routingKeyExpression- the SpEL expression to determine a routing key against a request message.- Returns:
- the spec
-
routingKeyExpression
Set a SpEL expression to determine routing key for publishing a request message at runtime. Mutually exclusive withqueue(String). Used only together withexchange(String).- Parameters:
routingKeyExpression- the SpEL expression determine a routing key against a request message.- Returns:
- the spec
-
queue
Set a queue for publishing a request message. Mutually exclusive withexchange(String).- Parameters:
queue- the queue to send a request message.- Returns:
- the spec
-
queueExpression
Set a SpEL expression to determine a queue for publishing a request message at runtime. Mutually exclusive withexchange(String).- Parameters:
queueExpression- the SpEL expression to determine a queue against a request message.- Returns:
- the spec
-
queueFunction
Set a function to determine a queue for publishing a request message at runtime. Mutually exclusive withexchange(String).- Parameters:
queueFunction- the function to determine a queue against a request message.- Returns:
- the spec
-
queueExpression
Set a SpEL expression to determine a queue for publishing a request message at runtime. Mutually exclusive withexchange(String).- Parameters:
queueExpression- the SpEL expression to determine a queue against a request message.- Returns:
- the spec
-
replyPayloadType
Set a reply payload type. Used only in the gateway mode.- Parameters:
replyPayloadType- the reply payload type.- Returns:
- the spec
-
replyPayloadType
Set a reply payload type. Used only in the gateway mode.- Parameters:
replyPayloadType- the reply payload type.- Returns:
- the spec
-
replyPayloadTypeExpression
Set a SpEL expression for the reply payload type. Used only in the gateway mode. Must be evaluated to aClassorResolvableType.- 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 aClassorResolvableType.- 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 aClassorResolvableType.- Parameters:
replyPayloadTypeExpression- the expression for a reply payload type.- Returns:
- the spec
-
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
-