Skip to content

Commit

Permalink
Merge pull request #1678 from provenceee/fix-router-develop
Browse files Browse the repository at this point in the history
fix an issue where inputstream is sometimes lost.
  • Loading branch information
Sherlockhan authored Nov 29, 2024
2 parents 6975b2a + a69bc0a commit ba0b5d0
Show file tree
Hide file tree
Showing 32 changed files with 282 additions and 624 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2023-2023 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (C) 2023-2024 Huawei Technologies Co., Ltd. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,7 +32,7 @@ public class LaneTestEntity implements Serializable {
private final boolean enabled;

/**
* 构造方法
* constructor
*
* @param id id
* @param enabled enabled
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2023-2023 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (C) 2023-2024 Huawei Technologies Co., Ltd. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -53,7 +53,7 @@ public class LaneTest {
private final boolean isExecuteSpringTest;

/**
* 构造方法
* constructor
*/
public LaneTest() {
baseUrl = "http://127.0.0.1:" + System.getProperty("controller.port", "28019") + "/controller/getLaneBy";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (C) 2022-2024 Huawei Technologies Co., Ltd. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -41,7 +41,7 @@ public class ConsumerTest {
private final String dubboVersion;

/**
* 构造方法
* constructor
*/
public ConsumerTest() {
dubboVersion = System.getProperty("dubbo.running.version");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (C) 2022-2024 Huawei Technologies Co., Ltd. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -38,7 +38,7 @@ public class SpringAndDubboTest {
private final String baseUrl;

/**
* 构造方法
* constructor
*/
public SpringAndDubboTest() {
baseUrl = "http://127.0.0.1:" + System.getProperty("controller.port", "28020") + "/consumer/";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022-2023 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (C) 2022-2024 Huawei Technologies Co., Ltd. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -60,7 +60,7 @@ public class RouterTest {
private final boolean isExecuteSpringTest;

/**
* 构造方法
* constructor
*/
public RouterTest() throws InterruptedException {
testTagRouterBaseUrl =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2023-2023 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (C) 2023-2024 Huawei Technologies Co., Ltd. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -90,7 +90,7 @@ public class LaneTest {
private final boolean shouldTestWebclient;

/**
* 构造方法
* constructor
*/
public LaneTest() {
springCloudVersion = Optional.ofNullable(System.getenv("SPRING_CLOUD_VERSION")).orElse("Hoxton.RELEASE");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022-2023 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (C) 2022-2024 Huawei Technologies Co., Ltd. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -92,7 +92,7 @@ public class TagRouterTest {
private final String springCloudVersion;

/**
* 构造方法
* constructor
*/
public TagRouterTest() throws InterruptedException {
springCloudVersion = Optional.ofNullable(System.getenv("SPRING_CLOUD_VERSION")).orElse("Hoxton.RELEASE");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (C) 2022-2024 Huawei Technologies Co., Ltd. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -66,7 +66,7 @@ public class UrlInterceptor extends AbstractInterceptor {
private Set<String> supportRules;

/**
* 构造方法
* constructor
*/
public UrlInterceptor() {
config = PluginConfigManager.getPluginConfig(LoadbalancerConfig.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (C) 2022-2024 Huawei Technologies Co., Ltd. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,7 +32,7 @@ public class ClientFactoryDeclarer extends AbstractDeclarer {
private static final String METHOD_NAME = "getInstance";

/**
* 构造方法
* constructor
*/
public ClientFactoryDeclarer() {
super(ENHANCE_CLASS, INTERCEPT_CLASS, METHOD_NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class DispatcherServletInterceptor extends AbstractInterceptor {
private Function<Object, String> getRequestUri;

/**
* 构造方法
* constructor
*/
public DispatcherServletInterceptor() {
initFunction();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class ServiceDiscoveryRegistryDirectoryInterceptor extends AbstractInterc
private final AtomicBoolean isInitialized = new AtomicBoolean();

/**
* 构造方法
* constructor
*/
public ServiceDiscoveryRegistryDirectoryInterceptor() {
invokerRuleStrategyService = PluginServiceManager.getPluginService(InvokerRuleStrategyService.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Copyright (C) 2023-2024 Huawei Technologies Co., Ltd. All rights reserved.
*
* Licensed 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 io.sermant.router.spring.entity;

import java.util.Set;

/**
* Transparent transmission marks the key entity
*
* @author provenceee
* @since 2023-02-21
*/
public class Keys {
private final Set<String> matchedKeys;

private final Set<String> injectedTags;

/**
* Constructor
*
* @param matchedKeys Label routing transparent transmission markers
* @param injectedTags Swim lane transparent markers
*/
public Keys(Set<String> matchedKeys, Set<String> injectedTags) {
this.matchedKeys = matchedKeys;
this.injectedTags = injectedTags;
}

public Set<String> getMatchedKeys() {
return matchedKeys;
}

public Set<String> getInjectedTags() {
return injectedTags;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2023-2023 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (C) 2023-2024 Huawei Technologies Co., Ltd. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -23,6 +23,7 @@
import io.sermant.router.common.handler.Handler;
import io.sermant.router.common.metric.MetricsManager;
import io.sermant.router.common.utils.CollectionUtils;
import io.sermant.router.spring.entity.Keys;

import java.util.Collections;
import java.util.HashMap;
Expand Down Expand Up @@ -60,6 +61,19 @@ protected Map<String, List<String>> getRequestTag(Map<String, List<String>> head
return map;
}

/**
* Obtain transparent tags
*
* @param path The path of the request
* @param methodName http method
* @param headers HTTP request headers
* @param parameters URL parameter
* @param keys The key of the tag to be obtained
* @return Marks for transparent transmission
*/
public abstract Map<String, List<String>> getRequestTag(String path, String methodName,
Map<String, List<String>> headers, Map<String, List<String>> parameters, Keys keys);

/**
* Collect Lane Count Metric.
*
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit ba0b5d0

Please sign in to comment.