From 2b3456f53c1ac774e6a7587637f538f11ff2c324 Mon Sep 17 00:00:00 2001 From: atomzhong Date: Thu, 6 Apr 2023 16:54:44 +0800 Subject: [PATCH] RateLimitCaller invoke with query param and headers. --- CHANGELOG.md | 2 +- .../cloud/ratelimit/example/service/caller/Controller.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f37edf263..fea805c79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Change Log --- -- [feature: optimize polaris-ratelimit-example/ratelimit-caller-service, add custom label resolver.](https://github.com/Tencent/spring-cloud-tencent/pull/952) +- [feature: optimize polaris-ratelimit-example, add caller custom label resolver.](https://github.com/Tencent/spring-cloud-tencent/pull/951) - [feature: add config for customized local port.](https://github.com/Tencent/spring-cloud-tencent/pull/923) - [feat:support webclient and gateway report call metrics](https://github.com/Tencent/spring-cloud-tencent/pull/924) - [feature: optimize polaris-discovery-example/discovery-callee-service, add client-ip return.](https://github.com/Tencent/spring-cloud-tencent/pull/939) diff --git a/spring-cloud-tencent-examples/polaris-ratelimit-example/ratelimit-caller-service/src/main/java/com/tencent/cloud/ratelimit/example/service/caller/Controller.java b/spring-cloud-tencent-examples/polaris-ratelimit-example/ratelimit-caller-service/src/main/java/com/tencent/cloud/ratelimit/example/service/caller/Controller.java index 89993b2ef..f169e0116 100644 --- a/spring-cloud-tencent-examples/polaris-ratelimit-example/ratelimit-caller-service/src/main/java/com/tencent/cloud/ratelimit/example/service/caller/Controller.java +++ b/spring-cloud-tencent-examples/polaris-ratelimit-example/ratelimit-caller-service/src/main/java/com/tencent/cloud/ratelimit/example/service/caller/Controller.java @@ -76,7 +76,7 @@ public class Controller { } @GetMapping("/invoke/webclient") - public String invokeInfoWebClient(@RequestParam(defaultValue = "value1") String value1, @RequestParam(defaultValue = "value1") String value2, @RequestHeader Map headers) throws InterruptedException, ExecutionException { + public String invokeInfoWebClient(@RequestParam(defaultValue = "value1", required = false) String value1, @RequestParam(defaultValue = "value1", required = false) String value2, @RequestHeader Map headers) throws InterruptedException, ExecutionException { StringBuffer builder = new StringBuffer(); WebClient webClient = webClientBuilder.baseUrl("http://" + appName).build(); @@ -123,7 +123,7 @@ public class Controller { * @throws InterruptedException exception */ @GetMapping("/invoke") - public String invokeInfo(@RequestParam(defaultValue = "value1") String value1, @RequestParam(defaultValue = "value1") String value2, @RequestHeader Map headers) throws InterruptedException { + public String invokeInfo(@RequestParam(defaultValue = "value1", required = false) String value1, @RequestParam(defaultValue = "value1", required = false) String value2, @RequestHeader Map headers) throws InterruptedException { StringBuffer builder = new StringBuffer(); CountDownLatch count = new CountDownLatch(30); for (int i = 0; i < 30; i++) {