How can I change the feign URL during the runtime?

You can add an unannotated URI parameter (that can potentially be determined at runtime) and that will be the base path that will be used for the request. E.g.: @FeignClient(name = “dummy-name”, url = “https://this-is-a-placeholder.com”) public interface MyClient { @PostMapping(path = “/create”) UserDto createUser(URI baseUrl, @RequestBody UserDto userDto); } And then the usage will be: … Read more

Spring @EnableResourceServer vs @EnableOAuth2Sso

These annotations mark your services with different OAuth 2.0 roles. @EnableResourceServer annotation means that your service (in terms of OAuth 2.0 – Resource Server) expects an access token in order to process the request. Access token should be obtained from Authorization Server by OAuth 2.0 Client before calling the Resource Server. @EnableOAuth2Sso: marks your service … Read more

Spring Cloud Config Client Without Spring Boot

Refrenced: https://wenku.baidu.com/view/493cf9eba300a6c30d229f49.html Root WebApplicationContext and the Servlet WebApplicationContext uses Environment and initializes PropertySources based on the spring profile. For non-spring boot apps, we need to customize these to get the properties from Config Server and to refresh the beans whenever there is a property change. Below are the changes that needs to happen to get … Read more

Property ‘spring.profiles.active’ imported from location ‘class path resource [application-dev.yml]’ is invalid

Spring Boot 2.4 has improved the way that application.properties and application.yml files are processed. See here for details: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-Config-Data-Migration-Guide Long story short: If you have for example an application-local.yml and inside you defined spring: profiles: active: local then just remove this entry in the yaml file.