Class AmqpClientInboundGateway
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.endpoint.AbstractEndpoint
org.springframework.integration.gateway.MessagingGatewaySupport
org.springframework.integration.amqp.inbound.AmqpClientInboundGateway
- All Implemented Interfaces:
Aware
,BeanFactoryAware
,BeanNameAware
,DisposableBean
,InitializingBean
,ApplicationContextAware
,Lifecycle
,Phased
,SmartLifecycle
,ComponentSourceAware
,ExpressionCapable
,Pausable
,IntegrationPattern
,NamedComponent
,IntegrationInboundManagement
,IntegrationManagement
,ManageableLifecycle
,ManageableSmartLifecycle
,TrackableComponent
A
MessagingGatewaySupport
implementation for AMQP 1.0 client.
Based on the RabbitAmqpListenerContainer
and requires an AmqpConnectionFactory
.
An internal RabbitAmqpTemplate
is used to send replies.
- Since:
- 7.0
- Author:
- Artem Bilan
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.integration.gateway.MessagingGatewaySupport
MessagingGatewaySupport.ConvertingMessagingTemplate
Nested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagement
IntegrationManagement.ManagementOverrides
-
Field Summary
Fields inherited from class org.springframework.integration.gateway.MessagingGatewaySupport
messagingTemplate
Fields inherited from class org.springframework.integration.endpoint.AbstractEndpoint
lifecycleLock
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
EXPRESSION_PARSER, logger
Fields inherited from interface org.springframework.integration.support.management.IntegrationManagement
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE
-
Constructor Summary
ConstructorsConstructorDescriptionAmqpClientInboundGateway
(org.springframework.amqp.rabbitmq.client.AmqpConnectionFactory connectionFactory, String... queueNames) -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
protected void
doStart()
Subclasses must implement this method with the start behavior.protected void
doStop()
Subclasses must implement this method with the stop behavior.boolean
isPaused()
Check if the endpoint is paused.protected void
onInit()
Subclasses may implement this for initialization logic.void
pause()
Pause the endpoint.void
resume()
Resume the endpoint if paused.void
setAdviceChain
(Advice... advices) void
setAfterReceivePostProcessors
(MessagePostProcessor... afterReceivePostProcessors) void
setAutoSettle
(boolean autoSettle) void
setConsumersPerQueue
(int consumersPerQueue) void
setDefaultRequeue
(boolean defaultRequeue) void
setGracefulShutdownPeriod
(Duration gracefulShutdownPeriod) void
setHeaderMapper
(AmqpHeaderMapper headerMapper) void
setInitialCredits
(int initialCredits) void
setMessageConverter
(@Nullable MessageConverter messageConverter) Set aMessageConverter
to replace the defaultSimpleMessageConverter
.void
setPriority
(int priority) void
setReplyExchange
(String exchange) Set a defaultexchange
for sending replies ifreplyTo
address is not provided in the request message.void
setReplyPostProcessor
(ReplyPostProcessor replyPostProcessor) void
setReplyQueue
(String queue) Set a defaultqueue
for sending replies ifreplyTo
address is not provided in the request message.void
setReplyRoutingKey
(String routingKey) Set a defaultroutingKey
for sending replies ifreplyTo
address is not provided in the request message.void
setStateListeners
(com.rabbitmq.client.amqp.Resource.StateListener... stateListeners) Methods inherited from class org.springframework.integration.gateway.MessagingGatewaySupport
buildErrorMessage, buildSendTimer, getErrorChannel, getErrorMessageAttributes, getErrorMessageStrategy, getIntegrationPatternType, getManagedName, getManagedType, getOverrides, getReplyChannel, getRequestChannel, isLoggingEnabled, isObserved, receive, receive, receiveMessage, receiveMessage, registerMetricsCaptor, registerObservationRegistry, registerReplyMessageCorrelatorIfNecessary, send, sendAndReceive, sendAndReceiveMessage, sendAndReceiveMessageReactive, sendTimer, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setErrorOnTimeout, setLoggingEnabled, setManagedName, setManagedType, setObservationConvention, setReceiverObservationConvention, setReplyChannel, setReplyChannelName, setReplyMapper, setReplyTimeout, setRequestChannel, setRequestChannelName, setRequestMapper, setRequestTimeout, setShouldTrack
Methods inherited from class org.springframework.integration.endpoint.AbstractEndpoint
doStop, getPhase, getRole, isActive, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stop
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentDescription, getComponentName, getComponentSource, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.integration.support.management.IntegrationManagement
getThisAs
Methods inherited from interface org.springframework.integration.support.management.ManageableLifecycle
isRunning, start, stop
Methods inherited from interface org.springframework.integration.support.context.NamedComponent
getBeanName, getComponentName
Methods inherited from interface org.springframework.context.SmartLifecycle
isPauseable
-
Constructor Details
-
AmqpClientInboundGateway
public AmqpClientInboundGateway(org.springframework.amqp.rabbitmq.client.AmqpConnectionFactory connectionFactory, String... queueNames)
-
-
Method Details
-
setInitialCredits
public void setInitialCredits(int initialCredits) -
setPriority
public void setPriority(int priority) -
setStateListeners
public void setStateListeners(com.rabbitmq.client.amqp.Resource.StateListener... stateListeners) -
setAfterReceivePostProcessors
-
setAdviceChain
-
setAutoSettle
public void setAutoSettle(boolean autoSettle) -
setDefaultRequeue
public void setDefaultRequeue(boolean defaultRequeue) -
setGracefulShutdownPeriod
-
setConsumersPerQueue
public void setConsumersPerQueue(int consumersPerQueue) -
setMessageConverter
Set aMessageConverter
to replace the defaultSimpleMessageConverter
. If set to null, an AMQP message is sent as is into aMessage
payload. And a reply message has to return an AMQP message as its payload.- Parameters:
messageConverter
- theMessageConverter
to use or null.
-
setHeaderMapper
-
setReplyPostProcessor
-
setReplyExchange
Set a defaultexchange
for sending replies ifreplyTo
address is not provided in the request message. Mutually exclusive withsetReplyQueue(String)
.- Parameters:
exchange
- the default exchange for sending replies
-
setReplyRoutingKey
Set a defaultroutingKey
for sending replies ifreplyTo
address is not provided in the request message. Used only ifsetReplyExchange(String)
is provided.- Parameters:
routingKey
- the default routing key for sending replies
-
setReplyQueue
Set a defaultqueue
for sending replies ifreplyTo
address is not provided in the request message. Mutually exclusive withsetReplyExchange(String)
.- Parameters:
queue
- the default queue for sending replies
-
getComponentType
- Specified by:
getComponentType
in interfaceNamedComponent
- Overrides:
getComponentType
in classMessagingGatewaySupport
-
onInit
protected void onInit()Description copied from class:IntegrationObjectSupport
Subclasses may implement this for initialization logic.- Overrides:
onInit
in classMessagingGatewaySupport
-
doStart
protected void doStart()Description copied from class:AbstractEndpoint
Subclasses must implement this method with the start behavior. This method will be invoked while holding theAbstractEndpoint.lifecycleLock
.- Overrides:
doStart
in classMessagingGatewaySupport
-
doStop
protected void doStop()Description copied from class:AbstractEndpoint
Subclasses must implement this method with the stop behavior. This method will be invoked while holding theAbstractEndpoint.lifecycleLock
.- Overrides:
doStop
in classMessagingGatewaySupport
-
destroy
public void destroy()- Specified by:
destroy
in interfaceDisposableBean
- Specified by:
destroy
in interfaceIntegrationManagement
- Overrides:
destroy
in classMessagingGatewaySupport
-
pause
-
resume
-
isPaused
-