mirror of https://github.com/apache/activemq.git
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1129835 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6fefadb620
commit
71c0d441f9
|
@ -348,6 +348,8 @@ public class ManagedRegionBroker extends RegionBroker {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void registerProducer(ObjectName key, ActiveMQDestination dest, ProducerView view) throws Exception {
|
protected void registerProducer(ObjectName key, ActiveMQDestination dest, ProducerView view) throws Exception {
|
||||||
|
|
||||||
|
if (dest != null) {
|
||||||
if (dest.isQueue()) {
|
if (dest.isQueue()) {
|
||||||
if (dest.isTemporary()) {
|
if (dest.isTemporary()) {
|
||||||
temporaryQueueProducers.put(key, view);
|
temporaryQueueProducers.put(key, view);
|
||||||
|
@ -361,6 +363,8 @@ public class ManagedRegionBroker extends RegionBroker {
|
||||||
topicProducers.put(key, view);
|
topicProducers.put(key, view);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
AnnotatedMBean.registerMBean(managementContext, view, key);
|
AnnotatedMBean.registerMBean(managementContext, view, key);
|
||||||
registeredMBeans.add(key);
|
registeredMBeans.add(key);
|
||||||
|
@ -499,7 +503,7 @@ public class ManagedRegionBroker extends RegionBroker {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void addInactiveSubscription(SubscriptionKey key, SubscriptionInfo info) {
|
protected void addInactiveSubscription(SubscriptionKey key, SubscriptionInfo info) {
|
||||||
Hashtable map = brokerObjectName.getKeyPropertyList();
|
Hashtable<String, String> map = brokerObjectName.getKeyPropertyList();
|
||||||
try {
|
try {
|
||||||
ObjectName objectName = new ObjectName(brokerObjectName.getDomain() + ":" + "BrokerName=" + map.get("BrokerName") + "," + "Type=Subscription," + "active=false,"
|
ObjectName objectName = new ObjectName(brokerObjectName.getDomain() + ":" + "BrokerName=" + map.get("BrokerName") + "," + "Type=Subscription," + "active=false,"
|
||||||
+ "name=" + JMXSupport.encodeObjectNamePart(key.toString()) + "");
|
+ "name=" + JMXSupport.encodeObjectNamePart(key.toString()) + "");
|
||||||
|
@ -671,8 +675,17 @@ public class ManagedRegionBroker extends RegionBroker {
|
||||||
// Build the object name for the producer info
|
// Build the object name for the producer info
|
||||||
Hashtable map = brokerObjectName.getKeyPropertyList();
|
Hashtable map = brokerObjectName.getKeyPropertyList();
|
||||||
|
|
||||||
String destinationType = "destinationType=" + producerInfo.getDestination().getDestinationTypeAsString();
|
String destinationType = "destinationType=";
|
||||||
String destinationName = "destinationName=" + JMXSupport.encodeObjectNamePart(producerInfo.getDestination().getPhysicalName());
|
String destinationName = "destinationName=";
|
||||||
|
|
||||||
|
if (producerInfo.getDestination() == null) {
|
||||||
|
destinationType += "NOTSET";
|
||||||
|
destinationName += "NOTSET";
|
||||||
|
} else {
|
||||||
|
destinationType += producerInfo.getDestination().getDestinationTypeAsString();
|
||||||
|
destinationName += JMXSupport.encodeObjectNamePart(producerInfo.getDestination().getPhysicalName());
|
||||||
|
}
|
||||||
|
|
||||||
String clientId = "clientId=" + JMXSupport.encodeObjectNamePart(connectionClientId);
|
String clientId = "clientId=" + JMXSupport.encodeObjectNamePart(connectionClientId);
|
||||||
String producerId = "producerId=" + JMXSupport.encodeObjectNamePart(producerInfo.getProducerId().toString());
|
String producerId = "producerId=" + JMXSupport.encodeObjectNamePart(producerInfo.getProducerId().toString());
|
||||||
|
|
||||||
|
|
|
@ -613,6 +613,10 @@ public class MBeanTest extends EmbeddedBrokerTestSupport {
|
||||||
assertEquals("topic1 Producer count", 0, topic1.getProducerCount());
|
assertEquals("topic1 Producer count", 0, topic1.getProducerCount());
|
||||||
assertEquals("topic2 Producer count", 0, topic2.getProducerCount());
|
assertEquals("topic2 Producer count", 0, topic2.getProducerCount());
|
||||||
|
|
||||||
|
MessageProducer producer4 = session.createProducer(null);
|
||||||
|
producer4.close();
|
||||||
|
Thread.sleep(500);
|
||||||
|
|
||||||
assertEquals("broker Topic Producer count", 0, broker.getTopicProducers().length);
|
assertEquals("broker Topic Producer count", 0, broker.getTopicProducers().length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue