mirror of
https://github.com/apache/rocketmq.git
synced 2026-09-24 16:04:00 +08:00
fix npe of SendMessageProcessorTest (#3632)
Co-authored-by: haozhijie <“haozhijie_9527@163.com”>
This commit is contained in:
co-authored by
haozhijie
parent
e1571eedb5
commit
7d1b001c2f
@@ -195,25 +195,45 @@ public class BrokerStatsManager {
|
||||
}
|
||||
|
||||
public String buildStatsKey(String topic, String group) {
|
||||
StringBuilder strBuilder = new StringBuilder(topic.length() + group.length() + 1);
|
||||
StringBuilder strBuilder;
|
||||
if (topic != null && group != null) {
|
||||
strBuilder = new StringBuilder(topic.length() + group.length() + 1);
|
||||
} else {
|
||||
strBuilder = new StringBuilder();
|
||||
}
|
||||
strBuilder.append(topic).append("@").append(group);
|
||||
return strBuilder.toString();
|
||||
}
|
||||
|
||||
public String buildStatsKey(String topic, int queueId) {
|
||||
StringBuilder strBuilder = new StringBuilder(topic.length() + 5);
|
||||
StringBuilder strBuilder;
|
||||
if (topic != null) {
|
||||
strBuilder = new StringBuilder(topic.length() + 5);
|
||||
} else {
|
||||
strBuilder = new StringBuilder();
|
||||
}
|
||||
strBuilder.append(topic).append("@").append(queueId);
|
||||
return strBuilder.toString();
|
||||
}
|
||||
|
||||
public String buildStatsKey(String topic, int queueId, String group) {
|
||||
StringBuilder strBuilder = new StringBuilder(topic.length() + group.length() + 6);
|
||||
StringBuilder strBuilder;
|
||||
if (topic != null && group != null) {
|
||||
strBuilder = new StringBuilder(topic.length() + group.length() + 6);
|
||||
} else {
|
||||
strBuilder = new StringBuilder();
|
||||
}
|
||||
strBuilder.append(topic).append("@").append(queueId).append("@").append(group);
|
||||
return strBuilder.toString();
|
||||
}
|
||||
|
||||
public String buildStatsKey(int queueId, String topic, String group) {
|
||||
StringBuilder strBuilder = new StringBuilder(topic.length() + group.length() + 6);
|
||||
StringBuilder strBuilder;
|
||||
if (topic != null && group != null) {
|
||||
strBuilder = new StringBuilder(topic.length() + group.length() + 6);
|
||||
} else {
|
||||
strBuilder = new StringBuilder();
|
||||
}
|
||||
strBuilder.append(queueId).append("@").append(topic).append("@").append(group);
|
||||
return strBuilder.toString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user