Pil0tXia commented on code in PR #55:
URL:
https://github.com/apache/eventmesh-dashboard/pull/55#discussion_r1524982999
##########
eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/storage/rocketmq4/Rocketmq4TopicCheck.java:
##########
@@ -138,30 +139,18 @@ public void init() {
//TODO there are many functions that can be reused, they should be
collected in a util module
//this function that create topics can be reused
- try {
- CreateTopicRequestHeader requestHeader = new
CreateTopicRequestHeader();
- requestHeader.setTopic(HealthConstant.ROCKETMQ_CHECK_TOPIC);
-
requestHeader.setTopicFilterType(TopicFilterType.SINGLE_TAG.name());
- requestHeader.setReadQueueNums(8);
- requestHeader.setWriteQueueNums(8);
- requestHeader.setPerm(PermName.PERM_READ | PermName.PERM_WRITE);
- RemotingCommand request =
RemotingCommand.createRequestCommand(RequestCode.UPDATE_AND_CREATE_TOPIC,
requestHeader);
- Object result =
remotingClient.invokeSync(getConfig().getRocketmqConfig().getBrokerUrl(),
request, getConfig().getRequestTimeoutMillis());
- log.info(result.toString());
- } catch (Exception e) {
- log.error("RocketmqTopicCheck init failed when examining topic
stats.", e);
- return;
- }
+ RocketmqUtils.createTopic(HealthConstant.ROCKETMQ_CHECK_TOPIC,
TopicFilterType.SINGLE_TAG.name(), PermName.PERM_READ | PermName.PERM_WRITE,
+ getConfig().getRocketmqProperties().getBrokerUrl(), 8, 8,
getConfig().getRequestTimeoutMillis());
Review Comment:
Please follow rocketmq's naming convention and use `namesrvAddr` instead of
`nameServerAddr`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]