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.
  • Field Details

    • SASL_MECHANISM_ANONYMOUS

      static final String SASL_MECHANISM_ANONYMOUS
      ANONYMOUS SASL mechanism (the default).
      See Also:
    • SASL_MECHANISM_PLAIN

      static final String SASL_MECHANISM_PLAIN
      PLAIN SASL mechanism (username and password).
      See Also:
    • SASL_MECHANISM_EXTERNAL

      static final String SASL_MECHANISM_EXTERNAL
      EXTERNAL SASL mechanism (e.g. client certificate).
      See Also:
  • Method Details

    • uri

      T uri(String 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

      T uris(String... 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

      T username(String username)
      The username to use.
      Parameters:
      username - username
      Returns:
      type-parameter object
    • password

      T password(String password)
      The password to use.
      Parameters:
      password - password
      Returns:
      type-parameter object
    • virtualHost

      T virtualHost(String virtualHost)
      The virtual host to connect to.
      Parameters:
      virtualHost -
      Returns:
      type-parameter object.
    • host

      T host(String host)
      The host to connect to.
      Parameters:
      host -
      Returns:
    • port

      T port(int port)
      The port to use to connect.
      Parameters:
      port -
      Returns:
      type-parameter object
    • credentialsProvider

      T credentialsProvider(CredentialsProvider credentialsProvider)
      Parameters:
      credentialsProvider - credentials provider
      Returns:
      type-parameter object
    • idleTimeout

      T idleTimeout(Duration idleTimeout)
      Idle timeout (heartbeat) to use.

      Default is 60 seconds.

      Parameters:
      idleTimeout -
      Returns:
      type-parameter object
    • connectionTimeout

      T connectionTimeout(Duration connectionTimeout)
      Timeout for the establishment of the TCP connection.

      The timeout applies to each connection attempt. It does not include the TLS handshake and the AMQP connection opening.

      The timeout also applies to the WebSocket handshake when WebSocket is used.

      Default is 60 seconds.

      Parameters:
      connectionTimeout - connection timeout, must be positive
      Returns:
      type-parameter object
    • addressSelector

      T addressSelector(AddressSelector selector)
      The AddressSelector to use.
      Parameters:
      selector - address selector
      Returns:
      type-parameter object
    • saslMechanism

      T saslMechanism(String mechanism)
      SASL mechanism to use.

      Supported mechanisms are SASL_MECHANISM_ANONYMOUS, SASL_MECHANISM_PLAIN, and SASL_MECHANISM_EXTERNAL.

      Parameters:
      mechanism - SASL mechanism
      Returns:
      type-parameter object
      See Also:
    • 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
    • oauth2

      OAuth2Settings<? extends T> oauth2()
      OAuth 2 settings.

      OAuth 2 requires RabbitMQ 4.1 or more.

      Returns:
      OAuth 2 settings
      Since:
      0.4.0
      See Also: