Class SimpleConnectionFactoryBuilder
- java.lang.Object
-
- interlok.rabbitmq.ConnectionFactoryBuilder
-
- interlok.rabbitmq.SimpleConnectionFactoryBuilder
-
- Direct Known Subclasses:
BasicConnectionFactoryBuilder
@ComponentProfile(summary="Simple RabbitMQ Connection Builder", since="4.3.0") public class SimpleConnectionFactoryBuilder extends ConnectionFactoryBuilderA 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
BasicConnectionFactoryBuilderinstead.If you don't override the username and password in the broker-url then it's likely to default to
guest/guestwhich is the underlying SDK default.
-
-
Constructor Summary
Constructors Constructor Description SimpleConnectionFactoryBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.rabbitmq.client.ConnectionFactorybuild()Build the connection factory.java.lang.StringgetBrokerUrl()The RabbitMQ Broker URL.voidsetBrokerUrl(java.lang.String brokerUrl)The RabbitMQ Broker URL.<T extends SimpleConnectionFactoryBuilder>
TwithBrokerUrl(java.lang.String s)
-
-
-
Method Detail
-
build
public com.rabbitmq.client.ConnectionFactory build() throws java.lang.ExceptionDescription copied from class:ConnectionFactoryBuilderBuild the connection factory.- Specified by:
buildin classConnectionFactoryBuilder- Throws:
java.lang.Exception
-
withBrokerUrl
public <T extends SimpleConnectionFactoryBuilder> T withBrokerUrl(java.lang.String s)
-
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/vhostas 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/vhostas 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.
-
-