Class SimpleConnectionFactoryBuilder

  • Direct Known Subclasses:
    BasicConnectionFactoryBuilder

    @ComponentProfile(summary="Simple RabbitMQ Connection Builder",
                      since="4.3.0")
    public class SimpleConnectionFactoryBuilder
    extends ConnectionFactoryBuilder
    A simple connection factory for RabbitMQ.

    This is the simplest connection factory possible; everything required to connect must be specified as part of the broker-url. In the event that you want to have obfuscated passwords then you want to use BasicConnectionFactoryBuilder instead.

    If you don't override the username and password in the broker-url then it's likely to default to guest/guest which is the underlying SDK default.

    • Constructor Detail

      • SimpleConnectionFactoryBuilder

        public SimpleConnectionFactoryBuilder()
    • Method Detail

      • setBrokerUrl

        public void setBrokerUrl​(java.lang.String brokerUrl)
        The RabbitMQ Broker URL.

        Everything including the username and password may be defined on the broker url so you can configure something like amqp://admin:admin@localhost:5672/vhost as required.

        Since you may well have sensitive information in the URL, you can also use the external %sysprop{} and %env{} syntax in order to derive the broker URL from system properties or the environment, so %env{CLOUDAMQP_URL} is perfectly reasonable.

      • getBrokerUrl

        public java.lang.String getBrokerUrl()
        The RabbitMQ Broker URL.

        Everything including the username and password may be defined on the broker url so you can configure something like amqp://admin:admin@localhost:5672/vhost as required.

        Since you may well have sensitive information in the URL, you can also use the external %sysprop{} and %env{} syntax in order to derive the broker URL from system properties or the environment, so %env{CLOUDAMQP_URL} is perfectly reasonable.