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:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle, org.springframework.integration.context.ComponentSourceAware, org.springframework.integration.context.ExpressionCapable, org.springframework.integration.core.Pausable, org.springframework.integration.IntegrationPattern, org.springframework.integration.support.context.NamedComponent, org.springframework.integration.support.management.IntegrationInboundManagement, org.springframework.integration.support.management.IntegrationManagement, org.springframework.integration.support.management.ManageableLifecycle, org.springframework.integration.support.management.ManageableSmartLifecycle, org.springframework.integration.support.management.TrackableComponent
public class AmqpClientInboundGateway
extends org.springframework.integration.gateway.MessagingGatewaySupport
implements org.springframework.integration.core.Pausable
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
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.integration.gateway.MessagingGatewaySupport
org.springframework.integration.gateway.MessagingGatewaySupport.ConvertingMessagingTemplateNested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagement
org.springframework.integration.support.management.IntegrationManagement.ManagementOverrides -
Field Summary
Fields inherited from class org.springframework.integration.gateway.MessagingGatewaySupport
messagingTemplateFields inherited from class org.springframework.integration.endpoint.AbstractEndpoint
lifecycleLockFields inherited from class org.springframework.integration.context.IntegrationObjectSupport
EXPRESSION_PARSER, loggerFields inherited from interface org.springframework.integration.support.management.IntegrationManagement
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEFields 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 TypeMethodDescriptionvoiddestroy()protected voiddoStart()protected voiddoStop()booleanisPaused()protected voidonInit()voidpause()voidresume()voidsetAdviceChain(org.aopalliance.aop.Advice... advices) voidsetAfterReceivePostProcessors(org.springframework.amqp.core.MessagePostProcessor... afterReceivePostProcessors) voidsetAutoSettle(boolean autoSettle) voidsetConsumersPerQueue(int consumersPerQueue) voidsetDefaultRequeue(boolean defaultRequeue) voidsetGracefulShutdownPeriod(Duration gracefulShutdownPeriod) voidsetHeaderMapper(AmqpHeaderMapper headerMapper) voidsetInitialCredits(int initialCredits) voidsetMessageConverter(@Nullable org.springframework.amqp.support.converter.MessageConverter messageConverter) Set aMessageConverterto replace the defaultSimpleMessageConverter.voidsetPriority(int priority) voidsetReplyExchange(String exchange) Set a defaultexchangefor sending replies ifreplyToaddress is not provided in the request message.voidsetReplyPostProcessor(org.springframework.amqp.rabbit.listener.adapter.ReplyPostProcessor replyPostProcessor) voidsetReplyQueue(String queue) Set a defaultqueuefor sending replies ifreplyToaddress is not provided in the request message.voidsetReplyRoutingKey(String routingKey) Set a defaultroutingKeyfor sending replies ifreplyToaddress is not provided in the request message.voidsetStateListeners(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, setShouldTrackMethods inherited from class org.springframework.integration.endpoint.AbstractEndpoint
doStop, getPhase, getRole, isActive, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stopMethods 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, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.integration.support.management.IntegrationManagement
getThisAsMethods inherited from interface org.springframework.integration.support.management.ManageableLifecycle
isRunning, start, stopMethods inherited from interface org.springframework.integration.support.context.NamedComponent
getBeanName, getComponentNameMethods 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
public void setAfterReceivePostProcessors(org.springframework.amqp.core.MessagePostProcessor... afterReceivePostProcessors) -
setAdviceChain
public void setAdviceChain(org.aopalliance.aop.Advice... advices) -
setAutoSettle
public void setAutoSettle(boolean autoSettle) -
setDefaultRequeue
public void setDefaultRequeue(boolean defaultRequeue) -
setGracefulShutdownPeriod
-
setConsumersPerQueue
public void setConsumersPerQueue(int consumersPerQueue) -
setMessageConverter
public void setMessageConverter(@Nullable org.springframework.amqp.support.converter.MessageConverter messageConverter) Set aMessageConverterto replace the defaultSimpleMessageConverter. If set to null, an AMQP message is sent as is into aMessagepayload. And a reply message has to return an AMQP message as its payload.- Parameters:
messageConverter- theMessageConverterto use or null.
-
setHeaderMapper
-
setReplyPostProcessor
public void setReplyPostProcessor(org.springframework.amqp.rabbit.listener.adapter.ReplyPostProcessor replyPostProcessor) -
setReplyExchange
Set a defaultexchangefor sending replies ifreplyToaddress is not provided in the request message. Mutually exclusive withsetReplyQueue(String).- Parameters:
exchange- the default exchange for sending replies
-
setReplyRoutingKey
Set a defaultroutingKeyfor sending replies ifreplyToaddress 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 defaultqueuefor sending replies ifreplyToaddress is not provided in the request message. Mutually exclusive withsetReplyExchange(String).- Parameters:
queue- the default queue for sending replies
-
getComponentType
- Specified by:
getComponentTypein interfaceorg.springframework.integration.support.context.NamedComponent- Overrides:
getComponentTypein classorg.springframework.integration.gateway.MessagingGatewaySupport
-
onInit
protected void onInit()- Overrides:
onInitin classorg.springframework.integration.gateway.MessagingGatewaySupport
-
doStart
protected void doStart()- Overrides:
doStartin classorg.springframework.integration.gateway.MessagingGatewaySupport
-
doStop
protected void doStop()- Overrides:
doStopin classorg.springframework.integration.gateway.MessagingGatewaySupport
-
destroy
public void destroy()- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean- Specified by:
destroyin interfaceorg.springframework.integration.support.management.IntegrationManagement- Overrides:
destroyin classorg.springframework.integration.gateway.MessagingGatewaySupport
-
pause
public void pause()- Specified by:
pausein interfaceorg.springframework.integration.core.Pausable
-
resume
public void resume()- Specified by:
resumein interfaceorg.springframework.integration.core.Pausable
-
isPaused
public boolean isPaused()- Specified by:
isPausedin interfaceorg.springframework.integration.core.Pausable
-