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
Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
logger
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected AbstractAmqpChannel
protected void
destroyInstance
(AbstractAmqpChannel instance) Class<?>
int
getPhase()
boolean
boolean
void
setAcknowledgeMode
(AcknowledgeMode acknowledgeMode) void
setAdviceChain
(Advice[] adviceChain) void
setAmqpAdmin
(AmqpAdmin amqpAdmin) This is an optional reference to an AmqpAdmin to use when declaring a Queue implicitly for a PollableAmqpChannel.void
setAutoStartup
(boolean autoStartup) void
setBatchSize
(Integer batchSize) void
setBeanName
(String name) void
setChannelTransacted
(boolean channelTransacted) void
setConcurrentConsumers
(int concurrentConsumers) void
setConnectionFactory
(ConnectionFactory connectionFactory) void
setConsumersPerQueue
(Integer consumersPerQueue) void
setDefaultDeliveryMode
(MessageDeliveryMode defaultDeliveryMode) void
setEncoding
(String encoding) void
setErrorHandler
(ErrorHandler errorHandler) void
setExchange
(FanoutExchange exchange) Set the FanoutExchange to use.void
setExposeListenerChannel
(boolean exposeListenerChannel) void
setExtractPayload
(Boolean extractPayload) void
setHeadersLast
(boolean headersLast) void
setInboundHeaderMapper
(AmqpHeaderMapper inboundMapper) void
setInterceptors
(List<ChannelInterceptor> interceptors) void
setMaxSubscribers
(int maxSubscribers) void
setMessageConverter
(MessageConverter messageConverter) void
setMessagePropertiesConverter
(MessagePropertiesConverter messagePropertiesConverter) void
setMissingQueuesFatal
(Boolean missingQueuesFatal) void
setOutboundHeaderMapper
(AmqpHeaderMapper outboundMapper) void
setPhase
(int phase) void
setPrefetchCount
(int prefetchCount) void
setPubSub
(boolean pubSub) void
setQueueName
(String queueName) Set the Queue name to use.void
setReceiveTimeout
(long receiveTimeout) void
setRecoveryInterval
(long recoveryInterval) void
setShutdownTimeout
(long shutdownTimeout) void
setTaskExecutor
(Executor taskExecutor) void
setTemplateChannelTransacted
(boolean channelTransacted) void
setTransactionAttribute
(TransactionAttribute transactionAttribute) void
setTransactionManager
(PlatformTransactionManager transactionManager) void
start()
void
stop()
void
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:
setBeanName
in 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:
getObjectType
in interfaceFactoryBean<AbstractAmqpChannel>
- Specified by:
getObjectType
in classAbstractFactoryBean<AbstractAmqpChannel>
-
createInstance
- Specified by:
createInstance
in classAbstractFactoryBean<AbstractAmqpChannel>
-
isAutoStartup
public boolean isAutoStartup()- Specified by:
isAutoStartup
in interfaceSmartLifecycle
-
getPhase
public int getPhase()- Specified by:
getPhase
in interfacePhased
- Specified by:
getPhase
in interfaceSmartLifecycle
-
isRunning
public boolean isRunning() -
start
public void start() -
stop
public void stop() -
stop
- Specified by:
stop
in interfaceSmartLifecycle
-
destroyInstance
- Overrides:
destroyInstance
in classAbstractFactoryBean<AbstractAmqpChannel>
-