mirror of https://github.com/apache/activemq.git
added fix for NPE when adding durable subscribers
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@384223 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1ccd7bdbf0
commit
11c37a7be5
|
@ -15,11 +15,13 @@ package org.apache.activemq.broker.jmx;
|
|||
|
||||
import org.apache.activemq.broker.ConnectionContext;
|
||||
import org.apache.activemq.broker.region.Topic;
|
||||
import org.apache.activemq.command.ConsumerId;
|
||||
import org.apache.activemq.command.ConsumerInfo;
|
||||
import org.apache.activemq.command.RemoveSubscriptionInfo;
|
||||
|
||||
public class TopicView extends DestinationView implements TopicViewMBean{
|
||||
|
||||
public TopicView(ManagedRegionBroker broker, Topic destination){
|
||||
public TopicView(ManagedRegionBroker broker, Topic destination){
|
||||
super(broker, destination);
|
||||
}
|
||||
|
||||
|
@ -28,6 +30,11 @@ public class TopicView extends DestinationView implements TopicViewMBean{
|
|||
context.setBroker(broker);
|
||||
context.setClientId(clientId);
|
||||
ConsumerInfo info = new ConsumerInfo();
|
||||
ConsumerId consumerId = new ConsumerId();
|
||||
consumerId.setConnectionId(clientId);
|
||||
consumerId.setSessionId(0);
|
||||
consumerId.setValue(0);
|
||||
info.setConsumerId(consumerId);
|
||||
info.setDestination(destination.getActiveMQDestination());
|
||||
info.setSubcriptionName(subscriberName);
|
||||
broker.addConsumer(context, info);
|
||||
|
|
Loading…
Reference in New Issue