Skip to content

Commit

Permalink
Add client version check
Browse files Browse the repository at this point in the history
  • Loading branch information
drpmma committed Sep 8, 2023
1 parent 65412b0 commit b33c915
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import java.util.function.Consumer;
import javax.annotation.Nullable;
import org.apache.rocketmq.common.AbortProcessException;
import org.apache.rocketmq.common.MQVersion;
import org.apache.rocketmq.common.Pair;
import org.apache.rocketmq.common.ServiceThread;
import org.apache.rocketmq.common.UtilAll;
Expand Down Expand Up @@ -269,11 +270,13 @@ public void processRequestCommand(final ChannelHandlerContext ctx, final Remotin
Runnable run = buildProcessRequestHandler(ctx, cmd, pair, opaque);

if (isShuttingDown.get()) {
final RemotingCommand response = RemotingCommand.createResponseCommand(ResponseCode.GO_AWAY,
"please go away");
response.setOpaque(opaque);
writeResponse(ctx.channel(), cmd, response);
return;
if (cmd.getVersion() > MQVersion.Version.V5_1_3.ordinal()) {
final RemotingCommand response = RemotingCommand.createResponseCommand(ResponseCode.GO_AWAY,
"please go away");
response.setOpaque(opaque);
writeResponse(ctx.channel(), cmd, response);
return;
}
}

if (pair.getObject1().rejectRequest()) {
Expand Down

0 comments on commit b33c915

Please sign in to comment.