public class AmqpInboundGateway extends MessagingGatewaySupport
Modifier and Type | Class and Description |
---|---|
protected class |
AmqpInboundGateway.Listener |
IntegrationManagement.ManagementOverrides
messagingTemplate
lifecycleCondition, lifecycleLock
EXPRESSION_PARSER, logger
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
DEFAULT_PHASE
Constructor and Description |
---|
AmqpInboundGateway(AbstractMessageListenerContainer listenerContainer) |
AmqpInboundGateway(AbstractMessageListenerContainer listenerContainer,
AmqpTemplate amqpTemplate)
Construct
AmqpInboundGateway based on the provided AbstractMessageListenerContainer
to receive request messages and AmqpTemplate to send replies. |
Modifier and Type | Method and Description |
---|---|
protected void |
doStart()
Subclasses must implement this method with the start behavior.
|
protected void |
doStop()
Subclasses must implement this method with the stop behavior.
|
String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
protected AttributeAccessor |
getErrorMessageAttributes(Message<?> message)
Populate an
AttributeAccessor to be used when building an error message
with the errorMessageStrategy . |
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
void |
setBatchingStrategy(BatchingStrategy batchingStrategy)
Set a batching strategy to use when de-batching messages.
|
void |
setBindSourceMessage(boolean bindSourceMessage)
Set to true to bind the source message in the header named
IntegrationMessageHeaderAccessor.SOURCE_DATA . |
void |
setDefaultReplyTo(String defaultReplyTo)
The
defaultReplyTo address with the form
(exchange)/(routingKey) |
void |
setHeaderMapper(AmqpHeaderMapper headerMapper) |
void |
setMessageConverter(MessageConverter messageConverter)
Specify the
MessageConverter to convert request and reply to/from Message . |
void |
setRecoveryCallback(org.springframework.retry.RecoveryCallback<? extends Object> recoveryCallback)
Set a
RecoveryCallback when using retry within the gateway. |
void |
setReplyHeadersMappedLast(boolean replyHeadersMappedLast)
When mapping headers for the outbound (reply) message, determine whether the headers are
mapped before the message is converted, or afterwards.
|
void |
setRetryTemplate(org.springframework.retry.support.RetryTemplate retryTemplate)
Set a
RetryTemplate to use for retrying a message delivery within the
gateway. |
buildErrorMessage, buildSendTimer, destroy, getErrorChannel, getIntegrationPatternType, getManagedName, getManagedType, getOverrides, getReplyChannel, getRequestChannel, isLoggingEnabled, receive, receive, receiveMessage, receiveMessage, registerMetricsCaptor, registerReplyMessageCorrelatorIfNecessary, send, sendAndReceive, sendAndReceiveMessage, sendAndReceiveMessageReactive, sendTimer, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setErrorOnTimeout, setLoggingEnabled, setManagedName, setManagedType, setReplyChannel, setReplyChannelName, setReplyMapper, setReplyTimeout, setRequestChannel, setRequestChannelName, setRequestMapper, setRequestTimeout, setShouldTrack
doStop, getPhase, getRole, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stop
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getThisAs
getBeanName, getComponentName
public AmqpInboundGateway(AbstractMessageListenerContainer listenerContainer)
public AmqpInboundGateway(AbstractMessageListenerContainer listenerContainer, AmqpTemplate amqpTemplate)
AmqpInboundGateway
based on the provided AbstractMessageListenerContainer
to receive request messages and AmqpTemplate
to send replies.listenerContainer
- the AbstractMessageListenerContainer
to receive AMQP messages.amqpTemplate
- the AmqpTemplate
to send reply messages.public void setMessageConverter(MessageConverter messageConverter)
MessageConverter
to convert request and reply to/from Message
.
If the amqpTemplate
is explicitly set, this MessageConverter
isn't populated there. You must configure that external amqpTemplate
.messageConverter
- the MessageConverter
to use.public void setHeaderMapper(AmqpHeaderMapper headerMapper)
public void setDefaultReplyTo(String defaultReplyTo)
defaultReplyTo
address with the form
(exchange)/(routingKey)or
(queueName)if the request message doesn't have a
replyTo
property.
The second form uses the default exchange ("") and the queue name as
the routing key.defaultReplyTo
- the default replyTo
address to use.Address
public void setRetryTemplate(org.springframework.retry.support.RetryTemplate retryTemplate)
RetryTemplate
to use for retrying a message delivery within the
gateway. Unlike adding retry at the container level, this can be used with an
ErrorMessageSendingRecoverer
RecoveryCallback
to publish to the
error channel after retries are exhausted. You generally should not configure an
error channel when using retry here, use a RecoveryCallback
instead.retryTemplate
- the template.setRecoveryCallback(RecoveryCallback)
public void setRecoveryCallback(org.springframework.retry.RecoveryCallback<? extends Object> recoveryCallback)
RecoveryCallback
when using retry within the gateway.recoveryCallback
- the callback.setRetryTemplate(RetryTemplate)
public void setBatchingStrategy(BatchingStrategy batchingStrategy)
SimpleBatchingStrategy
.batchingStrategy
- the strategy.public void setBindSourceMessage(boolean bindSourceMessage)
IntegrationMessageHeaderAccessor.SOURCE_DATA
.bindSourceMessage
- true to bind.public void setReplyHeadersMappedLast(boolean replyHeadersMappedLast)
SimpleMessageConverter
with a
String payload that contains json; the converter will set the content type to
text/plain
which can be overridden to application/json
by setting
the AmqpHeaders.CONTENT_TYPE
message header. Default: false.replyHeadersMappedLast
- true if reply headers are mapped after conversion.public String getComponentType()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class MessagingGatewaySupport
protected void onInit()
IntegrationObjectSupport
onInit
in class MessagingGatewaySupport
protected void doStart()
AbstractEndpoint
AbstractEndpoint.lifecycleLock
.doStart
in class MessagingGatewaySupport
protected void doStop()
AbstractEndpoint
AbstractEndpoint.lifecycleLock
.doStop
in class MessagingGatewaySupport
protected AttributeAccessor getErrorMessageAttributes(Message<?> message)
MessagingGatewaySupport
AttributeAccessor
to be used when building an error message
with the errorMessageStrategy
.getErrorMessageAttributes
in class MessagingGatewaySupport
message
- the message.