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

[Enhancement] In ExpressionForRetryMessageFilter, iff the subscription type is TAG, we can return true directly. #7039

Closed
1 task done
HScarb opened this issue Jul 18, 2023 · 0 comments · Fixed by #7040
Closed
1 task done

Comments

@HScarb
Copy link
Contributor

HScarb commented Jul 18, 2023

Before Creating the Enhancement Request

  • I have confirmed that this should be classified as an enhancement rather than a bug/feature.

Summary

In ExpressionForRetryMessageFilter, when isRetryTopic is true and the subscription type is TAG, it won't return true now and will decode message properties, which decreases the performance.

boolean isRetryTopic = subscriptionData.getTopic().startsWith(MixAll.RETRY_GROUP_TOPIC_PREFIX);
if (!isRetryTopic && ExpressionType.isTagType(subscriptionData.getExpressionType())) {
return true;
}
ConsumerFilterData realFilterData = this.consumerFilterData;
Map<String, String> tempProperties = properties;
boolean decoded = false;
if (isRetryTopic) {
// retry topic, use original filter data.
// poor performance to support retry filter.
if (tempProperties == null && msgBuffer != null) {
decoded = true;
tempProperties = MessageDecoder.decodeProperties(msgBuffer);
}
String realTopic = tempProperties.get(MessageConst.PROPERTY_RETRY_TOPIC);
String group = subscriptionData.getTopic().substring(MixAll.RETRY_GROUP_TOPIC_PREFIX.length());
realFilterData = this.consumerFilterManager.get(realTopic, group);
}

Motivation

Enhance ExpressionForRetryMessageFilter performance. We don't need to decode message properties when isRetryTopic is true and the subscription type is TAG. Because tag subscriptions will be filtered on the client side.

Describe the Solution You'd Like

Return true directly when the subscription type is TAG.

Describe Alternatives You've Considered

none

Additional Context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant