[ISSUE #3906] Mark stream-related request by RequestType

This commit is contained in:
zhouxiang
2022-06-20 11:50:07 +08:00
committed by yukon
parent fe5c39cdbd
commit 34eb2ce7d1
7 changed files with 108 additions and 2 deletions
@@ -89,6 +89,7 @@ public class MixAll {
public static final String REPLY_MESSAGE_FLAG = "reply";
public static final String LMQ_PREFIX = "%LMQ%";
public static final String MULTI_DISPATCH_QUEUE_SPLITTER = ",";
public static final String REQ_T = "ReqT";
private static final InternalLogger log = InternalLoggerFactory.getLogger(LoggerName.COMMON_LOGGER_NAME);
public static String getWSAddr() {
@@ -0,0 +1,34 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.rocketmq.common.rpchook;
import org.apache.rocketmq.common.MixAll;
import org.apache.rocketmq.remoting.RPCHook;
import org.apache.rocketmq.remoting.protocol.RemotingCommand;
import org.apache.rocketmq.remoting.protocol.RequestType;
public class StreamTypeRPCHook implements RPCHook {
@Override public void doBeforeRequest(String remoteAddr, RemotingCommand request) {
request.addExtField(MixAll.REQ_T, String.valueOf(RequestType.STREAM.getCode()));
}
@Override public void doAfterResponse(String remoteAddr, RemotingCommand request,
RemotingCommand response) {
}
}