Class AmqpChannelFactoryBean
java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<AbstractAmqpChannel>
org.springframework.integration.amqp.config.AmqpChannelFactoryBean
- All Implemented Interfaces:
Aware,BeanClassLoaderAware,BeanFactoryAware,BeanNameAware,DisposableBean,FactoryBean<AbstractAmqpChannel>,InitializingBean,Lifecycle,Phased,SmartLifecycle
public class AmqpChannelFactoryBean extends AbstractFactoryBean<AbstractAmqpChannel> implements SmartLifecycle, BeanNameAware
If point-to-point, we send to the default exchange with the routing key
equal to "[beanName]" and we declare that same Queue and register a listener
if message-driven or poll explicitly otherwise. If publish-subscribe, we declare
a FanoutExchange named "si.fanout.[beanName]" and we send to that without any
routing key, and on the receiving side, we create an anonymous Queue that is
bound to that exchange.
- Since:
- 2.1
- Author:
- Mark Fisher, Gary Russell, Artem Bilan
-
Field Summary
-
Constructor Summary
Constructors Constructor Description AmqpChannelFactoryBean()AmqpChannelFactoryBean(boolean messageDriven) -
Method Summary
Modifier and Type Method Description protected AbstractAmqpChannelcreateInstance()protected voiddestroyInstance(AbstractAmqpChannel instance)Class<?>getObjectType()intgetPhase()booleanisAutoStartup()booleanisRunning()voidsetAcknowledgeMode(AcknowledgeMode acknowledgeMode)voidsetAdviceChain(Advice[] adviceChain)voidsetAmqpAdmin(AmqpAdmin amqpAdmin)This is an optional reference to an AmqpAdmin to use when declaring a Queue implicitly for a PollableAmqpChannel.voidsetAutoStartup(boolean autoStartup)voidsetBatchSize(Integer batchSize)voidsetBeanName(String name)voidsetChannelTransacted(boolean channelTransacted)voidsetConcurrentConsumers(int concurrentConsumers)voidsetConnectionFactory(ConnectionFactory connectionFactory)voidsetConsumersPerQueue(Integer consumersPerQueue)voidsetDefaultDeliveryMode(MessageDeliveryMode defaultDeliveryMode)voidsetEncoding(String encoding)voidsetErrorHandler(ErrorHandler errorHandler)voidsetExchange(FanoutExchange exchange)Set the FanoutExchange to use.voidsetExposeListenerChannel(boolean exposeListenerChannel)voidsetExtractPayload(Boolean extractPayload)voidsetHeadersLast(boolean headersLast)voidsetInboundHeaderMapper(AmqpHeaderMapper inboundMapper)voidsetInterceptors(List<ChannelInterceptor> interceptors)voidsetMaxSubscribers(int maxSubscribers)voidsetMessageConverter(MessageConverter messageConverter)voidsetMessagePropertiesConverter(MessagePropertiesConverter messagePropertiesConverter)voidsetMissingQueuesFatal(Boolean missingQueuesFatal)voidsetOutboundHeaderMapper(AmqpHeaderMapper outboundMapper)voidsetPhase(int phase)voidsetPrefetchCount(int prefetchCount)voidsetPubSub(boolean pubSub)voidsetQueueName(String queueName)Set the Queue name to use.voidsetReceiveTimeout(long receiveTimeout)voidsetRecoveryInterval(long recoveryInterval)voidsetShutdownTimeout(long shutdownTimeout)voidsetTaskExecutor(Executor taskExecutor)voidsetTemplateChannelTransacted(boolean channelTransacted)voidsetTransactionAttribute(TransactionAttribute transactionAttribute)voidsetTransactionManager(PlatformTransactionManager transactionManager)voidstart()voidstop()voidstop(Runnable callback)Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
-
Constructor Details
-
AmqpChannelFactoryBean
public AmqpChannelFactoryBean() -
AmqpChannelFactoryBean
public AmqpChannelFactoryBean(boolean messageDriven)
-
-
Method Details
-
setBeanName
- Specified by:
setBeanNamein interfaceBeanNameAware
-
setInterceptors
-
setAmqpAdmin
This is an optional reference to an AmqpAdmin to use when declaring a Queue implicitly for a PollableAmqpChannel. It is not needed for the message-driven (Subscribable) channels since those are able to create a RabbitAdmin instance using the underlying listener container's ConnectionFactory.- Parameters:
amqpAdmin- The amqp admin.
-
setExchange
Set the FanoutExchange to use. This is only relevant for publish-subscribe-channels, and even then if not provided, a FanoutExchange will be implicitly created.- Parameters:
exchange- The fanout exchange.
-
setQueueName
Set the Queue name to use. This is only relevant for point-to-point channels, even then if not provided, a Queue will be implicitly created.- Parameters:
queueName- The queue name.
-
setEncoding
-
setMessageConverter
-
setTemplateChannelTransacted
public void setTemplateChannelTransacted(boolean channelTransacted) -
setChannelTransacted
public void setChannelTransacted(boolean channelTransacted) -
setConnectionFactory
-
setMessagePropertiesConverter
-
setAcknowledgeMode
-
setAdviceChain
-
setAutoStartup
public void setAutoStartup(boolean autoStartup) -
setConcurrentConsumers
public void setConcurrentConsumers(int concurrentConsumers) -
setConsumersPerQueue
-
setErrorHandler
-
setExposeListenerChannel
public void setExposeListenerChannel(boolean exposeListenerChannel) -
setPhase
public void setPhase(int phase) -
setPrefetchCount
public void setPrefetchCount(int prefetchCount) -
setPubSub
public void setPubSub(boolean pubSub) -
setReceiveTimeout
public void setReceiveTimeout(long receiveTimeout) -
setRecoveryInterval
public void setRecoveryInterval(long recoveryInterval) -
setShutdownTimeout
public void setShutdownTimeout(long shutdownTimeout) -
setTaskExecutor
-
setTransactionAttribute
-
setTransactionManager
-
setBatchSize
-
setMaxSubscribers
public void setMaxSubscribers(int maxSubscribers) -
setMissingQueuesFatal
-
setDefaultDeliveryMode
-
setExtractPayload
-
setOutboundHeaderMapper
-
setInboundHeaderMapper
-
setHeadersLast
public void setHeadersLast(boolean headersLast) -
getObjectType
- Specified by:
getObjectTypein interfaceFactoryBean<AbstractAmqpChannel>- Specified by:
getObjectTypein classAbstractFactoryBean<AbstractAmqpChannel>
-
createInstance
- Specified by:
createInstancein classAbstractFactoryBean<AbstractAmqpChannel>
-
isAutoStartup
public boolean isAutoStartup()- Specified by:
isAutoStartupin interfaceSmartLifecycle
-
getPhase
public int getPhase()- Specified by:
getPhasein interfacePhased- Specified by:
getPhasein interfaceSmartLifecycle
-
isRunning
public boolean isRunning() -
start
public void start() -
stop
public void stop() -
stop
- Specified by:
stopin interfaceSmartLifecycle
-
destroyInstance
- Overrides:
destroyInstancein classAbstractFactoryBean<AbstractAmqpChannel>
-