public class ConnectionOptions extends Object
Constructor and Description |
---|
ConnectionOptions() |
ConnectionOptions(com.rabbitmq.client.ConnectionFactory connectionFactory)
Creates a new Options object for the
connectionFactory . |
Modifier and Type | Method and Description |
---|---|
ConnectionOptions |
copy()
Returns a new copy of the options.
|
com.rabbitmq.client.Address[] |
getAddresses()
Returns the addresses to attempt connections to, in round-robin order.
|
com.rabbitmq.client.ConnectionFactory |
getConnectionFactory()
Returns the ConnectionFactory for the options.
|
ExecutorService |
getConsumerExecutor()
Returns the consumer executor.
|
String |
getName() |
ConnectionOptions |
withAddresses(com.rabbitmq.client.Address... addresses)
Sets the
addresses to attempt connections to, in round-robin order. |
ConnectionOptions |
withAddresses(String addresses)
Sets the
addresses . |
ConnectionOptions |
withClientProperties(Map<String,Object> clientProperties)
Sets the client properties.
|
ConnectionOptions |
withConnectionFactory(com.rabbitmq.client.ConnectionFactory connectionFactory)
Sets the
connectionFactory . |
ConnectionOptions |
withConnectionTimeout(Duration connectionTimeout)
Set the connection timeout, zero for infinite, for an individual connection attempt.
|
ConnectionOptions |
withConsumerExecutor(ExecutorService executor)
Sets the executor used to handle consumer callbacks.
|
ConnectionOptions |
withHost(String host)
Sets the
host . |
ConnectionOptions |
withHosts(String... hosts)
Sets the
hosts to attempt connections to, in round-robin order. |
ConnectionOptions |
withName(String name)
Sets the connection name.
|
ConnectionOptions |
withPassword(String password)
Sets the password.
|
ConnectionOptions |
withPort(int port)
Set the port.
|
ConnectionOptions |
withRequestedHeartbeat(Duration requestedHeartbeat)
Set the requested heartbeat, zero for none.
|
ConnectionOptions |
withSocketFactory(SocketFactory socketFactory)
Sets the SocketFactory to create connections with.
|
ConnectionOptions |
withSsl()
Enabled SSL using SSLv3.
|
ConnectionOptions |
withSslProtocol(SSLContext sslContext)
Sets the initialized
sslContext to use. |
ConnectionOptions |
withSslProtocol(String sslProtocol)
Sets the
sslProtocol to use. |
ConnectionOptions |
withSslProtocol(String sslProtocol,
TrustManager trustManager)
Sets the
sslProtocol and trustManager to use. |
ConnectionOptions |
withUsername(String username)
Sets the username.
|
ConnectionOptions |
withVirtualHost(String virtualHost)
Sets the virtual host.
|
public ConnectionOptions()
public ConnectionOptions(com.rabbitmq.client.ConnectionFactory connectionFactory)
connectionFactory
.NullPointerException
- if connectionFactory
is nullpublic ConnectionOptions copy()
public com.rabbitmq.client.Address[] getAddresses()
public com.rabbitmq.client.ConnectionFactory getConnectionFactory()
public ExecutorService getConsumerExecutor()
withConsumerExecutor(ExecutorService)
public String getName()
public ConnectionOptions withAddresses(com.rabbitmq.client.Address... addresses)
addresses
to attempt connections to, in round-robin order.NullPointerException
- if addresses
is nullpublic ConnectionOptions withAddresses(String addresses)
addresses
.addresses
- formatted as "host1[:port],host2[:port]", etc.NullPointerException
- if addresses
is nullpublic ConnectionOptions withClientProperties(Map<String,Object> clientProperties)
NullPointerException
- if clientProperties
is nullpublic ConnectionOptions withConnectionFactory(com.rabbitmq.client.ConnectionFactory connectionFactory)
connectionFactory
.NullPointerException
- if connectionFactory
is nullpublic ConnectionOptions withConnectionTimeout(Duration connectionTimeout)
NullPointerException
- if connectionTimeout
is nullpublic ConnectionOptions withConsumerExecutor(ExecutorService executor)
executor
will not be shutdown
when a connection is closed.NullPointerException
- if executor
is nullpublic ConnectionOptions withHost(String host)
host
.NullPointerException
- if host
is nullpublic ConnectionOptions withHosts(String... hosts)
hosts
to attempt connections to, in round-robin order.NullPointerException
- if hosts
is nullpublic ConnectionOptions withName(String name)
NullPointerException
- if name
is nullpublic ConnectionOptions withPassword(String password)
public ConnectionOptions withPort(int port)
public ConnectionOptions withRequestedHeartbeat(Duration requestedHeartbeat)
NullPointerException
- if requestedHeartbeat
is nullpublic ConnectionOptions withSocketFactory(SocketFactory socketFactory)
NullPointerException
- if hosts
is nullpublic ConnectionOptions withSsl() throws NoSuchAlgorithmException, KeyManagementException
public ConnectionOptions withSslProtocol(SSLContext sslContext)
sslContext
to use.NullPointerException
- if sslContext
is nullpublic ConnectionOptions withSslProtocol(String sslProtocol) throws NoSuchAlgorithmException, KeyManagementException
sslProtocol
to use.NullPointerException
- if sslProtocol
is nullNoSuchAlgorithmException
KeyManagementException
public ConnectionOptions withSslProtocol(String sslProtocol, TrustManager trustManager) throws NoSuchAlgorithmException, KeyManagementException
sslProtocol
and trustManager
to use.NullPointerException
- if sslProtocol
or trustManager
are nullNoSuchAlgorithmException
KeyManagementException
public ConnectionOptions withUsername(String username)
NullPointerException
- if username
is nullpublic ConnectionOptions withVirtualHost(String virtualHost)
NullPointerException
- if virtualHost
is nullCopyright © 2016. All rights reserved.