Class AmqpChannelFactoryBean

java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<AbstractAmqpChannel>
org.springframework.integration.amqp.config.AmqpChannelFactoryBean
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<AbstractAmqpChannel>, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle

public class AmqpChannelFactoryBean
extends org.springframework.beans.factory.config.AbstractFactoryBean<AbstractAmqpChannel>
implements org.springframework.context.SmartLifecycle, org.springframework.beans.factory.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
  • Constructor Details

  • Method Details

    • setBeanName

      public void setBeanName​(@Nullable java.lang.String name)
      Specified by:
      setBeanName in interface org.springframework.beans.factory.BeanNameAware
    • setInterceptors

      public void setInterceptors​(java.util.List<org.springframework.messaging.support.ChannelInterceptor> interceptors)
    • setAmqpAdmin

      public void setAmqpAdmin​(org.springframework.amqp.core.AmqpAdmin amqpAdmin)
      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

      public void setExchange​(org.springframework.amqp.core.FanoutExchange exchange)
      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

      public void setQueueName​(java.lang.String queueName)
      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

      public void setEncoding​(java.lang.String encoding)
    • setMessageConverter

      public void setMessageConverter​(org.springframework.amqp.support.converter.MessageConverter messageConverter)
    • setTemplateChannelTransacted

      public void setTemplateChannelTransacted​(boolean channelTransacted)
    • setChannelTransacted

      public void setChannelTransacted​(boolean channelTransacted)
    • setConnectionFactory

      public void setConnectionFactory​(org.springframework.amqp.rabbit.connection.ConnectionFactory connectionFactory)
    • setMessagePropertiesConverter

      public void setMessagePropertiesConverter​(org.springframework.amqp.rabbit.support.MessagePropertiesConverter messagePropertiesConverter)
    • setAcknowledgeMode

      public void setAcknowledgeMode​(org.springframework.amqp.core.AcknowledgeMode acknowledgeMode)
    • setAdviceChain

      public void setAdviceChain​(org.aopalliance.aop.Advice[] adviceChain)
    • setAutoStartup

      public void setAutoStartup​(boolean autoStartup)
    • setConcurrentConsumers

      public void setConcurrentConsumers​(int concurrentConsumers)
    • setConsumersPerQueue

      public void setConsumersPerQueue​(java.lang.Integer consumersPerQueue)
    • setErrorHandler

      public void setErrorHandler​(org.springframework.util.ErrorHandler errorHandler)
    • 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

      public void setTaskExecutor​(java.util.concurrent.Executor taskExecutor)
    • setTransactionAttribute

      public void setTransactionAttribute​(org.springframework.transaction.interceptor.TransactionAttribute transactionAttribute)
    • setTransactionManager

      public void setTransactionManager​(org.springframework.transaction.PlatformTransactionManager transactionManager)
    • setBatchSize

      public void setBatchSize​(java.lang.Integer batchSize)
    • setMaxSubscribers

      public void setMaxSubscribers​(int maxSubscribers)
    • setMissingQueuesFatal

      public void setMissingQueuesFatal​(java.lang.Boolean missingQueuesFatal)
    • setDefaultDeliveryMode

      public void setDefaultDeliveryMode​(org.springframework.amqp.core.MessageDeliveryMode defaultDeliveryMode)
    • setExtractPayload

      public void setExtractPayload​(java.lang.Boolean extractPayload)
    • setOutboundHeaderMapper

      public void setOutboundHeaderMapper​(AmqpHeaderMapper outboundMapper)
    • setInboundHeaderMapper

      public void setInboundHeaderMapper​(AmqpHeaderMapper inboundMapper)
    • setHeadersLast

      public void setHeadersLast​(boolean headersLast)
    • getObjectType

      public java.lang.Class<?> getObjectType()
      Specified by:
      getObjectType in interface org.springframework.beans.factory.FactoryBean<AbstractAmqpChannel>
      Specified by:
      getObjectType in class org.springframework.beans.factory.config.AbstractFactoryBean<AbstractAmqpChannel>
    • createInstance

      protected AbstractAmqpChannel createInstance()
      Specified by:
      createInstance in class org.springframework.beans.factory.config.AbstractFactoryBean<AbstractAmqpChannel>
    • isAutoStartup

      public boolean isAutoStartup()
      Specified by:
      isAutoStartup in interface org.springframework.context.SmartLifecycle
    • getPhase

      public int getPhase()
      Specified by:
      getPhase in interface org.springframework.context.Phased
      Specified by:
      getPhase in interface org.springframework.context.SmartLifecycle
    • isRunning

      public boolean isRunning()
      Specified by:
      isRunning in interface org.springframework.context.Lifecycle
    • start

      public void start()
      Specified by:
      start in interface org.springframework.context.Lifecycle
    • stop

      public void stop()
      Specified by:
      stop in interface org.springframework.context.Lifecycle
    • stop

      public void stop​(java.lang.Runnable callback)
      Specified by:
      stop in interface org.springframework.context.SmartLifecycle
    • destroyInstance

      protected void destroyInstance​(AbstractAmqpChannel instance)
      Overrides:
      destroyInstance in class org.springframework.beans.factory.config.AbstractFactoryBean<AbstractAmqpChannel>