Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #19]Message track query enhancement #21

Merged
merged 4 commits into from
Sep 23, 2021

Conversation

zhangjidi2016
Copy link
Contributor

What is the purpose of the change

#19

Brief changelog

XX

Verifying this change

XXXX

Follow this checklist to help us incorporate your contribution quickly and easily. Notice, it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR.

  • Make sure there is a Github issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test(over 80% coverage) to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in test module.
  • Run mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle to make sure basic checks pass. Run mvn clean install -DskipITs to make sure unit-test pass. Run mvn clean test-compile failsafe:integration-test to make sure integration-test pass.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

Copy link
Member

@StyleTang StyleTang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, this feature helps users who use custom track message topic to query message trace. 👍
I have several comments here.

  1. message track topic should have a default value, after this PR, each user will need at least 3 clicks when making a query message trace query (even if they use the default message track topic).
  2. I suggest that the message track topic should be in the message trace page but not in MsgTraceDetailDialog, and the browser can cache which topic was chosen before.
  3. rocketmq.config.msgTrackTopicName is useless, we can just remove it.

@@ -64,7 +64,7 @@ public Object viewTraceMessages(@RequestParam String msgId) {

@RequestMapping(value = "/viewMessageTraceGraph.query", method = RequestMethod.GET)
@ResponseBody
public MessageTraceGraph viewMessageTraceGraph(@RequestParam String msgId) {
return messageTraceService.queryMessageTraceGraph(msgId);
public MessageTraceGraph viewMessageTraceGraph(@RequestParam String msgId, @RequestParam String traceTopic) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is traceTopic must have? maybe we can use the default value if use don't choose the topic.

@RequestParam String traceTopic

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TraceTopic can be empty and system topic (RMQ_SYS_TRACE_TOPIC) is used by default.

Set<String> topics = new HashSet<>();
if (skipRetryAndDlq) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. What will happen if both skipSysProcess and skipRetryAndDlq are true.
  2. maybe we can handle skipSysProcess and skipRetryAndDlq together, for example use Java lambda stream.
allTopics.getTopicList().stream().map((item)->{
                ...
            }).filter(new Predicate<String>() {
                @Override
                public boolean apply(@Nullable String input) {
                    ...
                }
            }).collect(Collectors.toSet());

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, need to take into account the fact that both skipSysProcess and skipRetryAndDlq are true,I will optimize this method using stream.

@vongosling vongosling linked an issue Sep 15, 2021 that may be closed by this pull request
@StyleTang
Copy link
Member

In my point of view, I don't suggest putting the topic selection on the popover. It’s more appropriate to put it on the page.
If we put it on the message trace page, for most users who use the default message track topic, they can just ignore it, but on the popover, the unnecessary click is required.

image

I suggest something like below
image

Comment on lines 83 to 84
allTopics.getTopicList().clear();
allTopics.getTopicList().addAll(topics);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trivial. (and it is not introduced by this PR, I'm OK to merge it)
can just use

allTopics.setTopicList(topics);

console.log($scope.allTopicList)
for (const topic of $scope.allTopicList) {
if (topic.startsWith(RETRY_GROUP_TOPIC_PREFIX)
|| topic.startsWith(DLQ_GROUP_TOPIC_PREFIX)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍
It’s great to delete useless system topics

@StyleTang StyleTang merged commit 58336d9 into apache:master Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Message track query enhancement
2 participants