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 #8657] Make retry topic pop probability configurable #8658

Merged
merged 1 commit into from
Sep 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ public RemotingCommand processRequest(final ChannelHandlerContext ctx, RemotingC
// considered the same type because they share the same retry flag in previous fields.
// Therefore, needRetryV1 is designed as a subset of needRetry, and within a single request,
// only one type of retry topic is able to call popMsgFromQueue.
boolean needRetry = randomQ % 5 == 0;
boolean needRetry = randomQ < brokerConfig.getPopFromRetryProbability();
boolean needRetryV1 = false;
if (brokerConfig.isEnableRetryTopicV2() && brokerConfig.isRetrieveMessageFromPopRetryTopicV1()) {
needRetryV1 = randomQ % 2 == 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public class BrokerConfig extends BrokerIdentity {
// read message from pop retry topic v1, for the compatibility, will be removed in the future version
private boolean retrieveMessageFromPopRetryTopicV1 = true;
private boolean enableRetryTopicV2 = false;

private int popFromRetryProbability = 20;
private boolean realTimeNotifyConsumerChange = true;

private boolean litePullMessageEnable = true;
Expand Down Expand Up @@ -563,6 +563,15 @@ public void setEnablePopLog(boolean enablePopLog) {
this.enablePopLog = enablePopLog;
}

public int getPopFromRetryProbability() {
return popFromRetryProbability;
}

public void setPopFromRetryProbability(int popFromRetryProbability) {
this.popFromRetryProbability = popFromRetryProbability;
}


public boolean isTraceOn() {
return traceOn;
}
Expand Down
Loading