Browse Source

🎉 动态网关启动时加载配置

test
smallchill 5 years ago
parent
commit
8ecaaa9047
  1. 3
      blade-gateway/src/main/java/org/springblade/gateway/dynamic/DynamicRouteServiceListener.java

3
blade-gateway/src/main/java/org/springblade/gateway/dynamic/DynamicRouteServiceListener.java

@ -77,6 +77,9 @@ public class DynamicRouteServiceListener {
return null;
}
});
String configInfo = configService.getConfig(dataId, group, 5000);
List<RouteDefinition> routeDefinitions = JSON.parseArray(configInfo, RouteDefinition.class);
dynamicRouteService.updateList(routeDefinitions);
} catch (NacosException ignored) {
}

Loading…
Cancel
Save