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.ConvertingMessagingTemplateNested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagement
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()Subclasses must implement this method with the start behavior.protected voiddoStop()Subclasses must implement this method with the stop behavior.booleanisPaused()Check if the endpoint is paused.protected voidonInit()Subclasses may implement this for initialization logic.voidpause()Pause the endpoint.voidresume()Resume the endpoint if paused.voidsetAdviceChain(Advice... advices) voidsetAfterReceivePostProcessors(MessagePostProcessor... afterReceivePostProcessors) voidsetAutoSettle(boolean autoSettle) voidsetConsumersPerQueue(int consumersPerQueue) voidsetDefaultRequeue(boolean defaultRequeue) voidsetGracefulShutdownPeriod(Duration gracefulShutdownPeriod) voidsetHeaderMapper(AmqpHeaderMapper headerMapper) voidsetInitialCredits(int initialCredits) voidsetMessageConverter(@Nullable 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(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 java.lang.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
-
setAdviceChain
-
setAutoSettle
public void setAutoSettle(boolean autoSettle) -
setDefaultRequeue
public void setDefaultRequeue(boolean defaultRequeue) -
setGracefulShutdownPeriod
-
setConsumersPerQueue
public void setConsumersPerQueue(int consumersPerQueue) -
setMessageConverter
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
-
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 interfaceNamedComponent- Overrides:
getComponentTypein classMessagingGatewaySupport
-
onInit
protected void onInit()Description copied from class:IntegrationObjectSupportSubclasses may implement this for initialization logic.- Overrides:
onInitin classMessagingGatewaySupport
-
doStart
protected void doStart()Description copied from class:AbstractEndpointSubclasses must implement this method with the start behavior. This method will be invoked while holding theAbstractEndpoint.lifecycleLock.- Overrides:
doStartin classMessagingGatewaySupport
-
doStop
protected void doStop()Description copied from class:AbstractEndpointSubclasses must implement this method with the stop behavior. This method will be invoked while holding theAbstractEndpoint.lifecycleLock.- Overrides:
doStopin classMessagingGatewaySupport
-
destroy
public void destroy()- Specified by:
destroyin interfaceDisposableBean- Specified by:
destroyin interfaceIntegrationManagement- Overrides:
destroyin classMessagingGatewaySupport
-
pause
-
resume
-
isPaused
-