public class AmqpInboundGateway
extends org.springframework.integration.gateway.MessagingGatewaySupport
| Modifier and Type | Class and Description |
|---|---|
protected class |
AmqpInboundGateway.Listener |
messagingTemplatelifecycleCondition, lifecycleLockEXPRESSION_PARSER, logger| Constructor and Description |
|---|
AmqpInboundGateway(org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer listenerContainer) |
AmqpInboundGateway(org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer listenerContainer,
org.springframework.amqp.core.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() |
protected void |
doStop() |
java.lang.String |
getComponentType() |
protected org.springframework.core.AttributeAccessor |
getErrorMessageAttributes(org.springframework.messaging.Message<?> message) |
protected void |
onInit() |
void |
setDefaultReplyTo(java.lang.String defaultReplyTo)
The
defaultReplyTo address with the form
(exchange)/(routingKey) |
void |
setHeaderMapper(AmqpHeaderMapper headerMapper) |
void |
setMessageConverter(org.springframework.amqp.support.converter.MessageConverter messageConverter)
Specify the
MessageConverter to convert request and reply to/from Message. |
void |
setRecoveryCallback(org.springframework.retry.RecoveryCallback<? extends java.lang.Object> recoveryCallback)
Set a
RecoveryCallback when using retry within the gateway. |
void |
setRetryTemplate(org.springframework.retry.support.RetryTemplate retryTemplate)
Set a
RetryTemplate to use for retrying a message delivery within the
gateway. |
buildErrorMessage, getErrorChannel, getManagedName, getManagedType, getMessageCount, getMessageCountLong, getOverrides, getReplyChannel, getRequestChannel, isCountsEnabled, isLoggingEnabled, receive, receive, receiveMessage, receiveMessage, registerReplyMessageCorrelatorIfNecessary, reset, send, sendAndReceive, sendAndReceiveMessage, sendAndReceiveMessageReactive, setCountsEnabled, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setLoggingEnabled, setManagedName, setManagedType, setReplyChannel, setReplyChannelName, setReplyMapper, setReplyTimeout, setRequestChannel, setRequestChannelName, setRequestMapper, setRequestTimeout, setShouldTrackdestroy, doStop, getPhase, getRole, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, setTaskScheduler, start, stop, stopafterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetComponentNamepublic AmqpInboundGateway(org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer listenerContainer)
public AmqpInboundGateway(org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer listenerContainer,
org.springframework.amqp.core.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(org.springframework.amqp.support.converter.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(java.lang.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.Addresspublic 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 java.lang.Object> recoveryCallback)
RecoveryCallback when using retry within the gateway.recoveryCallback - the callback.setRetryTemplate(RetryTemplate)public java.lang.String getComponentType()
getComponentType in interface org.springframework.integration.support.context.NamedComponentgetComponentType in class org.springframework.integration.gateway.MessagingGatewaySupportprotected void onInit()
throws java.lang.Exception
onInit in class org.springframework.integration.gateway.MessagingGatewaySupportjava.lang.Exceptionprotected void doStart()
doStart in class org.springframework.integration.gateway.MessagingGatewaySupportprotected void doStop()
doStop in class org.springframework.integration.gateway.MessagingGatewaySupportprotected org.springframework.core.AttributeAccessor getErrorMessageAttributes(org.springframework.messaging.Message<?> message)
getErrorMessageAttributes in class org.springframework.integration.gateway.MessagingGatewaySupport