mirror of https://github.com/apache/activemq.git
use the subscription name in the object key of a durable subscription so that it is more unique so that the MBeanTest can pass.
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@453075 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
09ebb720d3
commit
44aece5020
|
@ -26,6 +26,7 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
import javax.management.InstanceNotFoundException;
|
import javax.management.InstanceNotFoundException;
|
||||||
import javax.management.MBeanServer;
|
import javax.management.MBeanServer;
|
||||||
import javax.management.MalformedObjectNameException;
|
import javax.management.MalformedObjectNameException;
|
||||||
|
@ -37,6 +38,7 @@ import javax.management.openmbean.OpenDataException;
|
||||||
import javax.management.openmbean.TabularData;
|
import javax.management.openmbean.TabularData;
|
||||||
import javax.management.openmbean.TabularDataSupport;
|
import javax.management.openmbean.TabularDataSupport;
|
||||||
import javax.management.openmbean.TabularType;
|
import javax.management.openmbean.TabularType;
|
||||||
|
|
||||||
import org.apache.activemq.broker.Broker;
|
import org.apache.activemq.broker.Broker;
|
||||||
import org.apache.activemq.broker.BrokerService;
|
import org.apache.activemq.broker.BrokerService;
|
||||||
import org.apache.activemq.broker.ConnectionContext;
|
import org.apache.activemq.broker.ConnectionContext;
|
||||||
|
@ -67,6 +69,7 @@ import org.apache.activemq.util.ServiceStopper;
|
||||||
import org.apache.activemq.util.SubscriptionKey;
|
import org.apache.activemq.util.SubscriptionKey;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
import edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap;
|
import edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap;
|
||||||
import edu.emory.mathcs.backport.java.util.concurrent.CopyOnWriteArraySet;
|
import edu.emory.mathcs.backport.java.util.concurrent.CopyOnWriteArraySet;
|
||||||
|
|
||||||
|
@ -175,9 +178,9 @@ public class ManagedRegionBroker extends RegionBroker {
|
||||||
String destinationName = "";
|
String destinationName = "";
|
||||||
String clientID = "";
|
String clientID = "";
|
||||||
SubscriptionKey key = new SubscriptionKey(context.getClientId(), sub.getConsumerInfo().getSubcriptionName());
|
SubscriptionKey key = new SubscriptionKey(context.getClientId(), sub.getConsumerInfo().getSubcriptionName());
|
||||||
if (sub.getConsumerInfo().isDurable()) {
|
|
||||||
persistentMode = "Durable";
|
|
||||||
|
|
||||||
|
if (sub.getConsumerInfo().isDurable()) {
|
||||||
|
persistentMode = "Durable, subscriptionID=" + JMXSupport.encodeObjectNamePart(sub.getConsumerInfo().getSubcriptionName());
|
||||||
} else {
|
} else {
|
||||||
persistentMode = "Non-Durable";
|
persistentMode = "Non-Durable";
|
||||||
}
|
}
|
||||||
|
@ -187,8 +190,8 @@ public class ManagedRegionBroker extends RegionBroker {
|
||||||
clientID = context.getClientId();
|
clientID = context.getClientId();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ObjectName objectName = new ObjectName(brokerObjectName.getDomain() + ":" + "BrokerName=" + map.get("BrokerName")
|
ObjectName objectName = new ObjectName(brokerObjectName.getDomain() + ":" + "BrokerName=" + map.get("BrokerName")
|
||||||
+ "," + "Type=Subscription, persistentMode=" + persistentMode + ", destinationType=" + destinationType + " ,destinationName=" + JMXSupport.encodeObjectNamePart(destinationName) + " ,clientID=" + JMXSupport.encodeObjectNamePart(clientID) + "");
|
+ "," + "Type=Subscription, persistentMode=" + persistentMode + ", destinationType=" + destinationType + ", destinationName=" + JMXSupport.encodeObjectNamePart(destinationName) + ", clientID=" + JMXSupport.encodeObjectNamePart(clientID) + "");
|
||||||
SubscriptionView view;
|
SubscriptionView view;
|
||||||
if (sub.getConsumerInfo().isDurable()) {
|
if (sub.getConsumerInfo().isDurable()) {
|
||||||
view = new DurableSubscriptionView(this, context.getClientId(), sub);
|
view = new DurableSubscriptionView(this, context.getClientId(), sub);
|
||||||
|
|
Loading…
Reference in New Issue