List of usage examples for com.rabbitmq.client Connection getClientProperties
Map<String, Object> getClientProperties();
From source file:com.springsource.insight.plugin.rabbitmqClient.AbstractRabbitMQCollectionAspect.java
License:Apache License
protected void applyConnectionData(Operation op, Connection conn) { String connectionUrl = null;/*from w w w. ja va 2s.c om*/ if (conn instanceof AMQConnection) { connectionUrl = conn.toString(); } else { InetAddress address = conn.getAddress(); int port = conn.getPort(); StringBuilder sb = new StringBuilder("amqp://"); sb.append(address.getHostAddress()).append(":").append(port); connectionUrl = sb.toString(); } op.put("host", conn.getAddress().getHostAddress()); op.put("port", conn.getPort()); op.put("connectionUrl", connectionUrl); //try to extract server version String version = getVersion(conn.getServerProperties()); op.put("serverVersion", version); //try to extract client version version = getVersion(conn.getClientProperties()); op.put("clientVersion", version); }