Skip to content

Commit a69bc0a

Browse files
committed
*fix an issue where inputstream is sometimes lost.
Signed-off-by: provenceee <83857838+provenceee@users.noreply.github.com>
1 parent 6975b2a commit a69bc0a

File tree

32 files changed

+282
-624
lines changed

32 files changed

+282
-624
lines changed

sermant-integration-tests/dubbo-test/dubbo-integration-api/src/main/java/io/sermant/integration/entity/LaneTestEntity.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2023-2023 Huawei Technologies Co., Ltd. All rights reserved.
2+
* Copyright (C) 2023-2024 Huawei Technologies Co., Ltd. All rights reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -32,7 +32,7 @@ public class LaneTestEntity implements Serializable {
3232
private final boolean enabled;
3333

3434
/**
35-
* 构造方法
35+
* constructor
3636
*
3737
* @param id id
3838
* @param enabled enabled

sermant-integration-tests/dubbo-test/dubbo-integration-test/src/test/java/io/sermant/integration/lane/LaneTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2023-2023 Huawei Technologies Co., Ltd. All rights reserved.
2+
* Copyright (C) 2023-2024 Huawei Technologies Co., Ltd. All rights reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -53,7 +53,7 @@ public class LaneTest {
5353
private final boolean isExecuteSpringTest;
5454

5555
/**
56-
* 构造方法
56+
* constructor
5757
*/
5858
public LaneTest() {
5959
baseUrl = "http://127.0.0.1:" + System.getProperty("controller.port", "28019") + "/controller/getLaneBy";

sermant-integration-tests/dubbo-test/dubbo-integration-test/src/test/java/io/sermant/integration/registry/ConsumerTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved.
2+
* Copyright (C) 2022-2024 Huawei Technologies Co., Ltd. All rights reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -41,7 +41,7 @@ public class ConsumerTest {
4141
private final String dubboVersion;
4242

4343
/**
44-
* 构造方法
44+
* constructor
4545
*/
4646
public ConsumerTest() {
4747
dubboVersion = System.getProperty("dubbo.running.version");

sermant-integration-tests/dubbo-test/dubbo-integration-test/src/test/java/io/sermant/integration/registry/SpringAndDubboTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved.
2+
* Copyright (C) 2022-2024 Huawei Technologies Co., Ltd. All rights reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -38,7 +38,7 @@ public class SpringAndDubboTest {
3838
private final String baseUrl;
3939

4040
/**
41-
* 构造方法
41+
* constructor
4242
*/
4343
public SpringAndDubboTest() {
4444
baseUrl = "http://127.0.0.1:" + System.getProperty("controller.port", "28020") + "/consumer/";

sermant-integration-tests/dubbo-test/dubbo-integration-test/src/test/java/io/sermant/integration/router/RouterTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2022-2023 Huawei Technologies Co., Ltd. All rights reserved.
2+
* Copyright (C) 2022-2024 Huawei Technologies Co., Ltd. All rights reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -60,7 +60,7 @@ public class RouterTest {
6060
private final boolean isExecuteSpringTest;
6161

6262
/**
63-
* 构造方法
63+
* constructor
6464
*/
6565
public RouterTest() throws InterruptedException {
6666
testTagRouterBaseUrl =

sermant-integration-tests/spring-test/spring-integration-test/src/test/java/io/sermant/integration/lane/LaneTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2023-2023 Huawei Technologies Co., Ltd. All rights reserved.
2+
* Copyright (C) 2023-2024 Huawei Technologies Co., Ltd. All rights reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -90,7 +90,7 @@ public class LaneTest {
9090
private final boolean shouldTestWebclient;
9191

9292
/**
93-
* 构造方法
93+
* constructor
9494
*/
9595
public LaneTest() {
9696
springCloudVersion = Optional.ofNullable(System.getenv("SPRING_CLOUD_VERSION")).orElse("Hoxton.RELEASE");

sermant-integration-tests/spring-test/spring-integration-test/src/test/java/io/sermant/integration/router/TagRouterTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2022-2023 Huawei Technologies Co., Ltd. All rights reserved.
2+
* Copyright (C) 2022-2024 Huawei Technologies Co., Ltd. All rights reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -92,7 +92,7 @@ public class TagRouterTest {
9292
private final String springCloudVersion;
9393

9494
/**
95-
* 构造方法
95+
* constructor
9696
*/
9797
public TagRouterTest() throws InterruptedException {
9898
springCloudVersion = Optional.ofNullable(System.getenv("SPRING_CLOUD_VERSION")).orElse("Hoxton.RELEASE");

sermant-plugins/sermant-loadbalancer/dubbo-loadbalancer-plugin/src/main/java/io/sermant/loadbalancer/interceptor/UrlInterceptor.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved.
2+
* Copyright (C) 2022-2024 Huawei Technologies Co., Ltd. All rights reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -66,7 +66,7 @@ public class UrlInterceptor extends AbstractInterceptor {
6666
private Set<String> supportRules;
6767

6868
/**
69-
* 构造方法
69+
* constructor
7070
*/
7171
public UrlInterceptor() {
7272
config = PluginConfigManager.getPluginConfig(LoadbalancerConfig.class);

sermant-plugins/sermant-loadbalancer/spring-cloud-loadbalancer-plugin/src/main/java/io/sermant/loadbalancer/declarer/ClientFactoryDeclarer.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved.
2+
* Copyright (C) 2022-2024 Huawei Technologies Co., Ltd. All rights reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -32,7 +32,7 @@ public class ClientFactoryDeclarer extends AbstractDeclarer {
3232
private static final String METHOD_NAME = "getInstance";
3333

3434
/**
35-
* 构造方法
35+
* constructor
3636
*/
3737
public ClientFactoryDeclarer() {
3838
super(ENHANCE_CLASS, INTERCEPT_CLASS, METHOD_NAME);

sermant-plugins/sermant-monitor/monitor-plugin/src/main/java/io/sermant/monitor/interceptor/DispatcherServletInterceptor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class DispatcherServletInterceptor extends AbstractInterceptor {
4040
private Function<Object, String> getRequestUri;
4141

4242
/**
43-
* 构造方法
43+
* constructor
4444
*/
4545
public DispatcherServletInterceptor() {
4646
initFunction();

sermant-plugins/sermant-router/dubbo3-router-plugin/src/main/java/io/sermant/router/dubbo/interceptor/ServiceDiscoveryRegistryDirectoryInterceptor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public class ServiceDiscoveryRegistryDirectoryInterceptor extends AbstractInterc
3939
private final AtomicBoolean isInitialized = new AtomicBoolean();
4040

4141
/**
42-
* 构造方法
42+
* constructor
4343
*/
4444
public ServiceDiscoveryRegistryDirectoryInterceptor() {
4545
invokerRuleStrategyService = PluginServiceManager.getPluginService(InvokerRuleStrategyService.class);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* Copyright (C) 2023-2024 Huawei Technologies Co., Ltd. All rights reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package io.sermant.router.spring.entity;
18+
19+
import java.util.Set;
20+
21+
/**
22+
* Transparent transmission marks the key entity
23+
*
24+
* @author provenceee
25+
* @since 2023-02-21
26+
*/
27+
public class Keys {
28+
private final Set<String> matchedKeys;
29+
30+
private final Set<String> injectedTags;
31+
32+
/**
33+
* Constructor
34+
*
35+
* @param matchedKeys Label routing transparent transmission markers
36+
* @param injectedTags Swim lane transparent markers
37+
*/
38+
public Keys(Set<String> matchedKeys, Set<String> injectedTags) {
39+
this.matchedKeys = matchedKeys;
40+
this.injectedTags = injectedTags;
41+
}
42+
43+
public Set<String> getMatchedKeys() {
44+
return matchedKeys;
45+
}
46+
47+
public Set<String> getInjectedTags() {
48+
return injectedTags;
49+
}
50+
}

sermant-plugins/sermant-router/spring-router-plugin/src/main/java/io/sermant/router/spring/handler/AbstractHandler.java

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2023-2023 Huawei Technologies Co., Ltd. All rights reserved.
2+
* Copyright (C) 2023-2024 Huawei Technologies Co., Ltd. All rights reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@
2323
import io.sermant.router.common.handler.Handler;
2424
import io.sermant.router.common.metric.MetricsManager;
2525
import io.sermant.router.common.utils.CollectionUtils;
26+
import io.sermant.router.spring.entity.Keys;
2627

2728
import java.util.Collections;
2829
import java.util.HashMap;
@@ -60,6 +61,19 @@ protected Map<String, List<String>> getRequestTag(Map<String, List<String>> head
6061
return map;
6162
}
6263

64+
/**
65+
* Obtain transparent tags
66+
*
67+
* @param path The path of the request
68+
* @param methodName http method
69+
* @param headers HTTP request headers
70+
* @param parameters URL parameter
71+
* @param keys The key of the tag to be obtained
72+
* @return Marks for transparent transmission
73+
*/
74+
public abstract Map<String, List<String>> getRequestTag(String path, String methodName,
75+
Map<String, List<String>> headers, Map<String, List<String>> parameters, Keys keys);
76+
6377
/**
6478
* Collect Lane Count Metric.
6579
*

sermant-plugins/sermant-router/spring-router-plugin/src/main/java/io/sermant/router/spring/handler/AbstractMappingHandler.java

-55
This file was deleted.

sermant-plugins/sermant-router/spring-router-plugin/src/main/java/io/sermant/router/spring/handler/AbstractRequestTagHandler.java

-73
This file was deleted.

0 commit comments

Comments
 (0)