Class AmqpClientMessageProducer
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.endpoint.AbstractEndpoint
org.springframework.integration.endpoint.MessageProducerSupport
org.springframework.integration.amqp.inbound.AmqpClientMessageProducer
- All Implemented Interfaces:
Aware
,BeanFactoryAware
,BeanNameAware
,DisposableBean
,InitializingBean
,SmartInitializingSingleton
,ApplicationContextAware
,Lifecycle
,Phased
,SmartLifecycle
,ComponentSourceAware
,ExpressionCapable
,MessageProducer
,Pausable
,IntegrationPattern
,NamedComponent
,IntegrationInboundManagement
,IntegrationManagement
,ManageableLifecycle
,ManageableSmartLifecycle
,TrackableComponent
A
MessageProducerSupport
implementation for AMQP 1.0 client.
Based on the RabbitAmqpListenerContainer
and requires an AmqpConnectionFactory
.
- Since:
- 7.0
- Author:
- Artem Bilan
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagement
IntegrationManagement.ManagementOverrides
-
Field Summary
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
ConstructorsConstructorDescriptionAmqpClientMessageProducer
(org.springframework.amqp.rabbitmq.client.AmqpConnectionFactory connectionFactory, String... queueNames) -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
protected void
doStart()
Take no action by default.protected void
doStop()
Take no action by default.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
setBatchReceiveTimeout
(long batchReceiveTimeout) void
setBatchSize
(int batchSize) 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
setStateListeners
(com.rabbitmq.client.amqp.Resource.StateListener... stateListeners) void
setTaskScheduler
(TaskScheduler taskScheduler) Configure aTaskScheduler
for those components which logic relies on the scheduled tasks.Methods inherited from class org.springframework.integration.endpoint.MessageProducerSupport
afterSingletonsInstantiated, buildErrorMessage, getErrorChannel, getErrorMessageAttributes, getErrorMessageStrategy, getIntegrationPatternType, getMessagingTemplate, getOutputChannel, getRequiredOutputChannel, isObserved, registerObservationRegistry, sendErrorMessageIfNecessary, sendMessage, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setObservationConvention, setOutputChannel, setOutputChannelName, setSendTimeout, setShouldTrack, subscribeToPublisher
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, 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
getManagedName, getManagedType, getOverrides, getThisAs, isLoggingEnabled, registerMetricsCaptor, setLoggingEnabled, setManagedName, setManagedType
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
-
AmqpClientMessageProducer
public AmqpClientMessageProducer(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
-
setBatchSize
public void setBatchSize(int batchSize) -
setBatchReceiveTimeout
public void setBatchReceiveTimeout(long batchReceiveTimeout) -
setTaskScheduler
Description copied from class:IntegrationObjectSupport
Configure aTaskScheduler
for those components which logic relies on the scheduled tasks. If not provided, falls back to the globaltaskScheduler
bean in the application context, provided by the Spring Integration infrastructure.- Overrides:
setTaskScheduler
in classIntegrationObjectSupport
- Parameters:
taskScheduler
- theTaskScheduler
to use.- See Also:
-
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.- Parameters:
messageConverter
- theMessageConverter
to use or null.
-
setHeaderMapper
-
getComponentType
- Specified by:
getComponentType
in interfaceNamedComponent
- Overrides:
getComponentType
in classMessageProducerSupport
-
onInit
protected void onInit()Description copied from class:IntegrationObjectSupport
Subclasses may implement this for initialization logic.- Overrides:
onInit
in classMessageProducerSupport
-
doStart
protected void doStart()Description copied from class:MessageProducerSupport
Take no action by default. Subclasses may override this if they need lifecycle-managed behavior. Protected by 'lifecycleLock'.- Overrides:
doStart
in classMessageProducerSupport
-
doStop
protected void doStop()Description copied from class:MessageProducerSupport
Take no action by default. Subclasses may override this if they need lifecycle-managed behavior.- Overrides:
doStop
in classMessageProducerSupport
-
destroy
public void destroy()- Specified by:
destroy
in interfaceDisposableBean
- Specified by:
destroy
in interfaceIntegrationManagement
- Overrides:
destroy
in classAbstractEndpoint
-
pause
-
resume
-
isPaused
-