[AMQ-9623] Update ConnectionView to include WireFormatInfo

This commit is contained in:
Matt Pavlovich 2024-11-15 10:14:59 -06:00 committed by Matt Pavlovich
parent bd91d97861
commit bb4c8aac66
2 changed files with 16 additions and 0 deletions

View File

@ -22,6 +22,7 @@ import java.util.Set;
import javax.management.ObjectName; import javax.management.ObjectName;
import org.apache.activemq.broker.Connection; import org.apache.activemq.broker.Connection;
import org.apache.activemq.broker.TransportConnection;
import org.apache.activemq.util.IOExceptionSupport; import org.apache.activemq.util.IOExceptionSupport;
public class ConnectionView implements ConnectionViewMBean { public class ConnectionView implements ConnectionViewMBean {
@ -196,4 +197,12 @@ public class ConnectionView implements ConnectionViewMBean {
public long getConnectedTimestamp() { public long getConnectedTimestamp() {
return connection.getConnectedTimestamp(); return connection.getConnectedTimestamp();
} }
@Override
public String getWireFormatInfo() {
if(connection instanceof TransportConnection) {
return ((TransportConnection)connection).getRemoteWireFormatInfo().toString();
}
return "WireFormatInfo not available";
}
} }

View File

@ -139,4 +139,11 @@ public interface ConnectionViewMBean extends Service {
*/ */
@MBeanInfo("Time in ms since epoch when connection was established.") @MBeanInfo("Time in ms since epoch when connection was established.")
long getConnectedTimestamp(); long getConnectedTimestamp();
/**
* @return the WireFormatInfo information
*/
@MBeanInfo("WireFormatInfo for the connection")
public String getWireFormatInfo();
} }