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
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()Take no action by default.protected voiddoStop()Take no action by default.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) voidsetBatchReceiveTimeout(long batchReceiveTimeout) voidsetBatchSize(int batchSize) 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) voidsetStateListeners(com.rabbitmq.client.amqp.Resource.StateListener... stateListeners) voidsetTaskScheduler(TaskScheduler taskScheduler) Configure aTaskSchedulerfor 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, 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 java.lang.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
-
setBatchSize
public void setBatchSize(int batchSize) -
setBatchReceiveTimeout
public void setBatchReceiveTimeout(long batchReceiveTimeout) -
setTaskScheduler
Description copied from class:IntegrationObjectSupportConfigure aTaskSchedulerfor those components which logic relies on the scheduled tasks. If not provided, falls back to the globaltaskSchedulerbean in the application context, provided by the Spring Integration infrastructure.- Overrides:
setTaskSchedulerin classIntegrationObjectSupport- Parameters:
taskScheduler- theTaskSchedulerto 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 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 interfaceNamedComponent- Overrides:
getComponentTypein classMessageProducerSupport
-
onInit
protected void onInit()Description copied from class:IntegrationObjectSupportSubclasses may implement this for initialization logic.- Overrides:
onInitin classMessageProducerSupport
-
doStart
protected void doStart()Description copied from class:MessageProducerSupportTake no action by default. Subclasses may override this if they need lifecycle-managed behavior. Protected by 'lifecycleLock'.- Overrides:
doStartin classMessageProducerSupport
-
doStop
protected void doStop()Description copied from class:MessageProducerSupportTake no action by default. Subclasses may override this if they need lifecycle-managed behavior.- Overrides:
doStopin classMessageProducerSupport
-
destroy
public void destroy()- Specified by:
destroyin interfaceDisposableBean- Specified by:
destroyin interfaceIntegrationManagement- Overrides:
destroyin classAbstractEndpoint
-
pause
-
resume
-
isPaused
-