Class ConnectionConfig

java.lang.Object
org.acemq.amqp.transport.ConnectionConfig

public final class ConnectionConfig extends Object
Everything a transport needs in order to open a connection.
  • Method Details

    • url

      public static ConnectionConfig.Builder url(String url)
      Parameters:
      url - broker URL whose scheme selects the transport, for example amqp://localhost:5672
      Returns:
      a builder with safe defaults already applied
    • url

      public String url()
    • username

      public @Nullable String username()
    • password

      public @Nullable String password()
    • virtualHost

      public @Nullable String virtualHost()
    • clientName

      public String clientName()
    • connectionTimeout

      public Duration connectionTimeout()
    • confirmTimeout

      public Duration confirmTimeout()
      Returns:
      how long a publish waits for the broker to confirm it
    • blockedTimeout

      public Duration blockedTimeout()
      Returns:
      how long a publish waits for a blocked broker to resume before it is refused. Zero by default: a publish made while the broker is blocked is refused at once, as in the other AceMQ libraries, so the caller decides whether to wait. A positive value waits up to that long instead, for an application that would rather ride out a brief memory alarm than handle the refusal
    • security

      public Security security()
      Returns:
      how this connection is protected. Never null: a connection always has a policy, and the default is the safe one
    • maxOutstandingPublishes

      public int maxOutstandingPublishes()
      How many publishes may be waiting for a confirm at once.

      Only asynchronous publishing uses this, and it is the setting that keeps it honest: a publisher that hands out futures faster than the broker confirms them accumulates unconfirmed messages in memory until the process dies. Once the limit is reached, publishing blocks — turning a memory leak into backpressure, which is the trade a queueing library should make.

      Returns:
      the ceiling on unconfirmed publishes
    • publisherConfirms

      public boolean publisherConfirms()
      Returns:
      whether the caller's own publishes wait for a publisher confirm; what the library publishes on the caller's behalf always does
      See Also:
    • scheme

      public String scheme()
      Returns:
      the scheme of url(), used to select a transport
    • toString

      public String toString()
      Overrides:
      toString in class Object