Package com.rabbitmq.client.amqp
Interface ConnectionSettings<T>
- Type Parameters:
T
- the type of object returned by methods, usually the object itself
- All Known Subinterfaces:
AmqpEnvironmentBuilder.EnvironmentConnectionSettings
,ConnectionBuilder
public interface ConnectionSettings<T>
Settings for a connection.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Connection affinity settings.static interface
Context for theConnectionSettings.AffinityStrategy
.static interface
Strategy to pick candidate nodes with an affinity with a queue.static interface
TLS settings. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddressSelector
(AddressSelector selector) TheAddressSelector
to use.ConnectionSettings.Affinity
<? extends T> affinity()
Connection affinity settings.credentialsProvider
(CredentialsProvider credentialsProvider) TheCredentialsProvider
to use.The host to connect to.idleTimeout
(Duration idleTimeout) Idle timeout (heartbeat) to use.The password to use.port
(int port) The port to use to connect.saslMechanism
(String mechanism) SASL mechanism to use.ConnectionSettings.TlsSettings
<? extends T> tls()
TLS settings.The URI of a node to connect to.A list of URIs of nodes of the same cluster to use to connect to.The username to use.virtualHost
(String virtualHost) The virtual host to connect to.
-
Field Details
-
SASL_MECHANISM_ANONYMOUS
ANONYMOUS SASL mechanism (the default).- See Also:
-
SASL_MECHANISM_PLAIN
PLAIN SASL mechanism (username and password).- See Also:
-
SASL_MECHANISM_EXTERNAL
EXTERNAL SASL mechanism (e.g. client certificate).- See Also:
-
-
Method Details
-
uri
The URI of a node to connect to.URI must be of the form
amqp://guest:guest@localhost:5672/%2f
.- Parameters:
uri
- node URI- Returns:
- type-parameter object
- See Also:
-
uris
A list of URIs of nodes of the same cluster to use to connect to.URIs must be of the form
amqp://guest:guest@localhost:5672/%2f
.- Parameters:
uris
- list of node URIs- Returns:
- type-parameter object
- See Also:
-
username
The username to use.- Parameters:
username
- username- Returns:
- type-parameter object
-
password
The password to use.- Parameters:
password
- password- Returns:
- type-parameter object
-
virtualHost
The virtual host to connect to.- Parameters:
virtualHost
-- Returns:
- type-parameter object.
-
host
The host to connect to.- Parameters:
host
-- Returns:
-
port
The port to use to connect.- Parameters:
port
-- Returns:
- type-parameter object
-
credentialsProvider
TheCredentialsProvider
to use.- Parameters:
credentialsProvider
- credentials provider- Returns:
- type-parameter object
-
idleTimeout
Idle timeout (heartbeat) to use.Default is 60 seconds.
- Parameters:
idleTimeout
-- Returns:
- type-parameter object
-
addressSelector
TheAddressSelector
to use.- Parameters:
selector
- address selector- Returns:
- type-parameter object
-
saslMechanism
SASL mechanism to use.Supported mechanisms are
SASL_MECHANISM_ANONYMOUS
,SASL_MECHANISM_PLAIN
, andSASL_MECHANISM_EXTERNAL
.- Parameters:
mechanism
- SASL mechanism- Returns:
- type-parameter object
- See Also:
-
tls
ConnectionSettings.TlsSettings<? extends T> tls()TLS settings.- Returns:
- TLS settings
-
affinity
ConnectionSettings.Affinity<? extends T> affinity()Connection affinity settings.This is an experimental API, subject to change.
- Returns:
- affinity settings
-