diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ProducerView.java b/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ProducerView.java index 8dfb57c45e..81492b2d15 100644 --- a/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ProducerView.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ProducerView.java @@ -16,8 +16,6 @@ */ package org.apache.activemq.broker.jmx; -import javax.jms.Destination; - import org.apache.activemq.command.ActiveMQDestination; import org.apache.activemq.command.ProducerInfo; @@ -56,6 +54,14 @@ public class ProducerView implements ProducerViewMBean { return 0; } + @Override + public String getProducerId() { + if (info != null) { + return info.getProducerId().toString(); + } + return "NOTSET"; + } + @Override public String getDestinationName() { if (info != null && info.getDestination() != null) { diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ProducerViewMBean.java b/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ProducerViewMBean.java index c72f981076..31fc9f3f4a 100644 --- a/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ProducerViewMBean.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ProducerViewMBean.java @@ -36,6 +36,12 @@ public interface ProducerViewMBean { @MBeanInfo("ID of the Session the Producer is on.") long getSessionId(); + /** + * @return the id of Producer. + */ + @MBeanInfo("ID of the Producer.") + String getProducerId(); + /** * @return the destination name */