Skip to content

Commit e445b22

Browse files
committed
feat:support rate-limit window expiration.
Signed-off-by: Haotian Zhang <[email protected]>
1 parent aa8cfb2 commit e445b22

File tree

2 files changed

+10
-0
lines changed
  • polaris-common/polaris-client/src/main/java/com/tencent/polaris/client/flow
  • polaris-plugins/polaris-plugin-api/src/main/java/com/tencent/polaris/api/plugin/route

2 files changed

+10
-0
lines changed

polaris-common/polaris-client/src/main/java/com/tencent/polaris/client/flow/BaseFlow.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ public static Instance commonGetOneInstance(Extensions extensions, ServiceKey se
9696
ServiceConfig serviceConfig = extensions.getConfiguration().getProvider().getService();
9797
RouteInfo routeInfo = new RouteInfo(
9898
null, null, dstSvcInfo, null, "", serviceConfig);
99+
routeInfo.putRouterMetadata("metadataRoute", metadata);
99100
ResourcesResponse resourcesResponse = BaseFlow
100101
.syncGetResources(extensions, false, provider, flowControlParam);
101102
LOG.debug("[ConnectionManager]success to discover service {}", svcEventKey);

polaris-plugins/polaris-plugin-api/src/main/java/com/tencent/polaris/api/plugin/route/RouteInfo.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,15 @@ public Map<String, String> getRouterMetadata(String routerType) {
253253
return Collections.unmodifiableMap(metadata);
254254
}
255255

256+
public void putRouterMetadata(String routerType, Map<String, String> metadata) {
257+
Map<String, String> tempMetadata = routerMetadata.get(routerType);
258+
if (tempMetadata == null || tempMetadata.isEmpty()) {
259+
tempMetadata = new HashMap<>();
260+
routerMetadata.put(routerType, tempMetadata);
261+
}
262+
tempMetadata.putAll(metadata);
263+
}
264+
256265
public void setRouterArguments(Map<String, Set<RouteArgument>> routerArguments) {
257266
Map<String, Map<String, String>> routerMetadata = this.routerMetadata;
258267

0 commit comments

Comments
 (0)