mirror of https://github.com/apache/activemq.git
Construct a ConsumerId from a String
This commit is contained in:
parent
e90ce1aabb
commit
ccb119d896
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue