This commit is contained in:
Abhijeet Mishra
2024-05-09 16:34:37 +08:00
committed by GitHub
7 changed files with 26 additions and 1 deletions

View File

@@ -22,6 +22,7 @@
* clusterName (create on which cluster)
* brokerName (create on which broker)
* topicName
* messageType
* writeQueueNums
* readQueueNums
* perm //2 for write 4 for read 6 for write and read

View File

@@ -19,6 +19,8 @@ import com.google.common.base.Objects;
import java.util.List;
import org.apache.rocketmq.common.TopicConfig;
public class TopicConfigInfo {
private List<String> clusterNameList;
@@ -30,6 +32,7 @@ public class TopicConfigInfo {
private int readQueueNums;
private int perm;
private boolean order;
private String messageType;
public List<String> getClusterNameList() {
return clusterNameList;
@@ -91,6 +94,14 @@ public class TopicConfigInfo {
this.order = order;
}
public String getMessageType() {
return messageType;
}
public void setMessageType(TopicConfig topicConfig) {
this.messageType = topicConfig.getAttributes().getOrDefault("message.type", "NORMAL");
}
@Override
public boolean equals(Object o) {
if (this == o)
@@ -102,12 +113,13 @@ public class TopicConfigInfo {
readQueueNums == that.readQueueNums &&
perm == that.perm &&
order == that.order &&
messageType == that.messageType &&
Objects.equal(topicName, that.topicName);
}
@Override
public int hashCode() {
return Objects.hashCode(topicName, writeQueueNums, readQueueNums, perm, order);
return Objects.hashCode(topicName, writeQueueNums, readQueueNums, perm, order, messageType);
}
}

View File

@@ -155,6 +155,7 @@ public class TopicServiceImpl extends AbstractCommonService implements TopicServ
TopicConfigInfo topicConfigInfo = new TopicConfigInfo();
TopicConfig topicConfig = examineTopicConfig(topic, brokerData.getBrokerName());
BeanUtils.copyProperties(topicConfig, topicConfigInfo);
topicConfigInfo.setMessageType(topicConfig);
topicConfigInfo.setBrokerNameList(Lists.newArrayList(brokerData.getBrokerName()));
topicConfigInfoList.add(topicConfigInfo);
}

View File

@@ -88,6 +88,7 @@ var en = {
"KEY":"Key",
"MESSAGE_BODY":"Message Body",
"TOPIC_NAME":"topicName",
"MESSAGE_TYPE":"messageType",
"ORDER":"order",
"CONSUMER_CLIENT":"consumerClient",
"BROKER_OFFSET":"brokerOffset",

View File

@@ -89,6 +89,7 @@ var zh = {
"KEY":"值",
"MESSAGE_BODY":"消息主体",
"TOPIC_NAME":"主题名",
"MESSAGE_TYPE":"消息类型",
"ORDER":"顺序",
"CONSUMER_CLIENT":"消费者终端",
"BROKER_OFFSET":"代理者位点",

View File

@@ -333,6 +333,7 @@ module.controller('topicController', ['$scope', 'ngDialog', '$http', 'Notificati
perm: 6,
order: false,
topicName: "",
messageType: "NORMAL",
brokerNameList: []
}];
bIsUpdate = false;

View File

@@ -189,6 +189,14 @@
<span class="text-danger" ng-show="addAppForm.topicName.$error.required">{{'TOPIC_NAME'|translate}}不能为空.</span>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">{{'MESSAGE_TYPE'|translate}}:</label>
<div class="col-sm-10">
<input class="form-control" ng-model="item.messageType" name="messageType" type="text"
ng-disabled="ngDialogData.bIsUpdate" required/>
<span class="text-danger" ng-show="addAppForm.messageType.$error.required">{{'MESSAGE_TYPE'|translate}}不能为空.</span>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">{{'WRITE_QUEUE_NUMS'|translate}}:</label>
<div class="col-sm-10">