From 6d48b4b07789e0315ad7fd66f038fa8c19b721c7 Mon Sep 17 00:00:00 2001 From: "Timothy A. Bish" Date: Thu, 9 Jun 2011 22:06:18 +0000 Subject: [PATCH] https://issues.apache.org/jira/browse/AMQ-3337 The ProducerViewMBean should expose the ProducerId value. git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1134107 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/activemq/broker/jmx/ProducerView.java | 10 ++++++++-- .../apache/activemq/broker/jmx/ProducerViewMBean.java | 6 ++++++ 2 files changed, 14 insertions(+), 2 deletions(-) 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 */