protected void setRequestPropertiesWithHeaderInfo(Map<String, String> headerMap, Object request) {
        // Try to obtain the unique name of the target service from the headerMap.
        // Due to the MOSN routing logic, it may be different from the original service unique name.
        if (request instanceof SofaRequest) {
            String headerService = headerMap.get(RemotingConstants.HEAD_SERVICE);
            if (headerService == null) {
                headerService = headerMap.get(RemotingConstants.HEAD_TARGET_SERVICE);
            }
            if (StringUtils.isNotBlank(headerService)) {
                ((SofaRequest) request).setTargetServiceUniqueName(headerService);
            }
        }
    }
@Test
    public void testSetRequestPropertiesWithHeaderInfo() {
        String service1 = "testService1";
        String service2 = "testService2";
        Map<String, String> headerMap = new HashMap();
        headerMap.put(RemotingConstants.HEAD_TARGET_SERVICE, service1);
        SofaRequest sofaRequest = new SofaRequest();
        SofaRpcSerialization sofaRpcSerialization = new SofaRpcSerialization();
        sofaRpcSerialization.setRequestPropertiesWithHeaderInfo(headerMap, sofaRequest);
        Assert.assertEquals(service1, sofaRequest.getTargetServiceUniqueName());
        headerMap.put(RemotingConstants.HEAD_SERVICE, service2);
        sofaRpcSerialization.setRequestPropertiesWithHeaderInfo(headerMap, sofaRequest);
        Assert.assertEquals(service2, sofaRequest.getTargetServiceUniqueName());
    }