diff --git a/activemq-client/src/main/java/org/apache/activemq/command/ConsumerId.java b/activemq-client/src/main/java/org/apache/activemq/command/ConsumerId.java index e955763918..29a42ee098 100755 --- a/activemq-client/src/main/java/org/apache/activemq/command/ConsumerId.java +++ b/activemq-client/src/main/java/org/apache/activemq/command/ConsumerId.java @@ -35,6 +35,17 @@ public class ConsumerId implements DataStructure { public ConsumerId() { } + public ConsumerId(String str){ + if (str != null){ + String[] splits = str.split(":"); + if (splits != null && splits.length >= 3){ + this.connectionId = splits[0]; + this.sessionId = Long.parseLong(splits[1]); + this.value = Long.parseLong(splits[2]); + } + } + } + public ConsumerId(SessionId sessionId, long consumerId) { this.connectionId = sessionId.getConnectionId(); this.sessionId = sessionId.getValue();