Class RabbitConnectionFactoryBeanConfigurer

java.lang.Object
org.springframework.boot.amqp.autoconfigure.RabbitConnectionFactoryBeanConfigurer

public class RabbitConnectionFactoryBeanConfigurer extends Object
Configures RabbitConnectionFactoryBean with sensible defaults tuned using configuration properties.

Can be injected into application code and used to define a custom RabbitConnectionFactoryBean whose configuration is based upon that produced by auto-configuration.

Since:
4.0.0
Author:
Chris Bono, Moritz Halbritter, Andy Wilkinson, Phillip Webb, Scott Frederick
  • Constructor Details

    • RabbitConnectionFactoryBeanConfigurer

      public RabbitConnectionFactoryBeanConfigurer(ResourceLoader resourceLoader, RabbitProperties properties)
      Creates a new configurer that will use the given resourceLoader and properties.
      Parameters:
      resourceLoader - the resource loader
      properties - the properties
    • RabbitConnectionFactoryBeanConfigurer

      public RabbitConnectionFactoryBeanConfigurer(ResourceLoader resourceLoader, RabbitProperties properties, RabbitConnectionDetails connectionDetails)
      Creates a new configurer that will use the given resourceLoader, properties, and connectionDetails. The connection details have priority over the properties.
      Parameters:
      resourceLoader - the resource loader
      properties - the properties
      connectionDetails - the connection details
    • RabbitConnectionFactoryBeanConfigurer

      public RabbitConnectionFactoryBeanConfigurer(ResourceLoader resourceLoader, RabbitProperties properties, RabbitConnectionDetails connectionDetails, @Nullable SslBundles sslBundles)
      Creates a new configurer that will use the given resourceLoader, properties, connectionDetails, and sslBundles. The connection details have priority over the properties.
      Parameters:
      resourceLoader - the resource loader
      properties - the properties
      connectionDetails - the connection details
      sslBundles - the SSL bundles
  • Method Details

    • setCredentialsProvider

      public void setCredentialsProvider(@Nullable com.rabbitmq.client.impl.CredentialsProvider credentialsProvider)
    • setCredentialsRefreshService

      public void setCredentialsRefreshService(@Nullable com.rabbitmq.client.impl.CredentialsRefreshService credentialsRefreshService)
    • configure

      public void configure(org.springframework.amqp.rabbit.connection.RabbitConnectionFactoryBean factory)
      Configure the specified rabbit connection factory bean. The factory bean can be further tuned and default settings can be overridden. It is the responsibility of the caller to invoke RabbitConnectionFactoryBean.afterPropertiesSet() though.
      Parameters:
      factory - the RabbitConnectionFactoryBean instance to configure