spring-projects / spring-boot

Spring Boot helps you to create Spring-powered, production-grade applications and services with absolute minimum fuss.
https://spring.io/projects/spring-boot
Apache License 2.0
75.4k stars 40.75k forks source link

update el value in openfeign mapper by code 。如何动态更新openfeign中el表达式的值 #34229

Closed xlgo closed 1 year ago

xlgo commented 1 year ago

在 openfeign 中

@GetMapping("clusters/${clusterId}/deployments/{deploymentName}") ResultVO getDeployments(@PathVariable String deploymentName);

我写在配置文件中是生效的,我使用代码设置没有效果,我必须用代码修改 My writing in the configuration file is effective, and my use of code settings has no effect。I have to modify it with java code

System.setProperty("clusterId","2222"); SpringProperties.setProperty("clusterId","33333"); Environment environment = SpringUtil.getApplicationContext().getEnvironment(); ((StandardEnvironment) environment).getSystemProperties().put("clusterId","44444");

mhalbritter commented 1 year ago

Hey, please report that issue on the Spring Cloud OpenFeign tracker, thanks!