@Override
    public <Request extends RequestCommand> boolean deserializeContent(Request request)
        throws DeserializationException {
        if (request instanceof RpcRequestCommand) {
            RpcRequestCommand requestCommand = (RpcRequestCommand) request;
            Object header = requestCommand.getRequestHeader();
            if (!(header instanceof Map)) {
                throw new DeserializationException("Head of request is null or is not map");
            }
            Map<String, String> headerMap = (Map<String, String>) header;
            String traceId = headerMap.get("rpc_trace_context.sofaTraceId");
            String rpcId = headerMap.get("rpc_trace_context.sofaRpcId");
            long deserializeStartTime = System.nanoTime();
            try {
                byte[] content = requestCommand.getContent();
                if (content == null || content.length == 0) {
                    throw new DeserializationException("Content of request is null");
                }
                String service = headerMap.get(RemotingConstants.HEAD_SERVICE);
                ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();

                ClassLoader serviceClassLoader = ReflectCache.getServiceClassLoader(service);
                try {
                    Thread.currentThread().setContextClassLoader(serviceClassLoader);

                    Serializer rpcSerializer = com.alipay.sofa.rpc.codec.SerializerFactory
                        .getSerializer(requestCommand.getSerializer());
                    Object sofaRequest = ClassUtils.forName(requestCommand.getRequestClass()).newInstance();
                    rpcSerializer.decode(new ByteArrayWrapperByteBuf(requestCommand.getContent()),
                        sofaRequest, headerMap);

                    //for service mesh or other scene, we need to add more info from header
                    setRequestPropertiesWithHeaderInfo(headerMap, sofaRequest);
                    parseRequestHeader(headerMap, sofaRequest);

                    requestCommand.setRequestObject(sofaRequest);
                } finally {
                    Thread.currentThread().setContextClassLoader(oldClassLoader);
                }

                return true;
            } catch (Exception ex) {
                LOGGER.error("traceId={}, rpcId={}, Request deserializeContent exception, msg={}", traceId, rpcId,
                    ex.getMessage(), ex);
                throw new DeserializationException(ex.getMessage() + ", traceId=" + traceId + ", rpcId=" + rpcId, ex);
            } finally {
                // R6：Record request deserialization time
                recordDeserializeRequest(requestCommand, deserializeStartTime);
            }
        }
        return false;
    }
@Test
    public void deserializeRequestContent() {
        String traceId = "traceId";
        String rpcId = "rpcId";
        Map<String, String> headerMap = new HashMap<>();
        headerMap.put("rpc_trace_context.sofaTraceId", traceId);
        headerMap.put("rpc_trace_context.sofaRpcId", rpcId);

        RpcRequestCommand command = new RpcRequestCommand();
        command.setRequestHeader(headerMap);
        SofaRpcSerialization sofaRpcSerialization = new SofaRpcSerialization();
        boolean exp = false;
        try {
            sofaRpcSerialization.deserializeContent(command);
        } catch (DeserializationException e) {
            exp = true;
            Assert.assertEquals("Content of request is null, traceId=" + traceId + ", rpcId=" + rpcId, e.getMessage());
        }
        Assert.assertTrue(exp);
    }