Class ConnectionInfo

java.lang.Object
org.acemq.rabbitmq.admin.ConnectionInfo

public final class ConnectionInfo extends Object
One client connection, as the broker sees it.

The answer to "which client is doing this". A connection knows its user, its virtual host, where it came from, and — if the client bothered to set it — what the application calls itself.

  • Constructor Details

  • Method Details

    • name

      public String name()
      Returns:
      the broker's name for this connection, of the form 10.0.0.1:52344 -> 10.0.0.2:5672. This is the identifier RabbitAdmin.closeConnection(String, String) takes, and it contains spaces and a > — encode it before putting it in a URL, which that method does for you
    • user

      public String user()
      Returns:
      the broker user this connection authenticated as
    • vhost

      public String vhost()
    • state

      public String state()
      Returns:
      running, blocked, blocking or closed. blocked means a resource alarm is holding this publisher, and is the per-connection view of what Health.alarms() reports for the broker
    • isBlocked

      public boolean isBlocked()
      Returns:
      whether this connection is currently blocked by a resource alarm
    • node

      public String node()
    • protocol

      public String protocol()
      Returns:
      the protocol and version, for example AMQP 0-9-1
    • peerHost

      public String peerHost()
    • peerPort

      public int peerPort()
    • channels

      public int channels()
      Returns:
      how many channels are open on it
    • connectedAt

      public Optional<Instant> connectedAt()
      Returns:
      when it connected, if the broker reported it
    • ssl

      public boolean ssl()
    • userProvidedName

      public Optional<String> userProvidedName()
      Returns:
      the name the client gave itself, when it gave one. Worth setting in every application: without it a connection is an IP and a port, and identifying which of six services is the one misbehaving means matching ports against container addresses
    • clientProperties

      public Map<String,Object> clientProperties()
      Returns:
      what the client library reported about itself: product, version, platform
    • toString

      public String toString()
      Overrides:
      toString in class Object