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:
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.beans.factory.SmartInitializingSingleton, 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.MessageProducer, 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 AmqpClientMessageProducer
extends org.springframework.integration.endpoint.MessageProducerSupport
implements org.springframework.integration.core.Pausable
A
MessageProducerSupport implementation for AMQP 1.0 client.
Based on the RabbitAmqpListenerContainer and requires an AmqpConnectionFactory.
- Since:
- 7.0
- See Also:
-
Nested Class Summary
Nested 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.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
ConstructorsConstructorDescriptionAmqpClientMessageProducer(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) voidsetBatchReceiveTimeout(long batchReceiveTimeout) voidsetBatchSize(int batchSize) 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) voidsetStateListeners(com.rabbitmq.client.amqp.Resource.StateListener... stateListeners) voidsetTaskScheduler(org.springframework.scheduling.TaskScheduler taskScheduler) 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, subscribeToPublisherMethods 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, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.integration.support.management.IntegrationManagement
getManagedName, getManagedType, getOverrides, getThisAs, isLoggingEnabled, registerMetricsCaptor, setLoggingEnabled, setManagedName, setManagedTypeMethods 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
-
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
public void setAfterReceivePostProcessors(org.springframework.amqp.core.MessagePostProcessor... afterReceivePostProcessors) -
setBatchSize
public void setBatchSize(int batchSize) -
setBatchReceiveTimeout
public void setBatchReceiveTimeout(long batchReceiveTimeout) -
setTaskScheduler
public void setTaskScheduler(org.springframework.scheduling.TaskScheduler taskScheduler) - Overrides:
setTaskSchedulerin classorg.springframework.integration.context.IntegrationObjectSupport
-
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.- Parameters:
messageConverter- theMessageConverterto use or null.
-
setHeaderMapper
-
getComponentType
- Specified by:
getComponentTypein interfaceorg.springframework.integration.support.context.NamedComponent- Overrides:
getComponentTypein classorg.springframework.integration.endpoint.MessageProducerSupport
-
onInit
protected void onInit()- Overrides:
onInitin classorg.springframework.integration.endpoint.MessageProducerSupport
-
doStart
protected void doStart()- Overrides:
doStartin classorg.springframework.integration.endpoint.MessageProducerSupport
-
doStop
protected void doStop()- Overrides:
doStopin classorg.springframework.integration.endpoint.MessageProducerSupport
-
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.endpoint.AbstractEndpoint
-
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
-