Skip to content
This repository has been archived by the owner on Apr 28, 2022. It is now read-only.

Latest commit

 

History

History
22 lines (15 loc) · 1.24 KB

File metadata and controls

22 lines (15 loc) · 1.24 KB

feignclient-refreshscope-problem

Endpoints

Access

I set server.port=8080

So, for example, simply call http://localhost:8080/random

What happens

DynamicUrlConfiguration registers itself as a Listener for EmbeddedServletContainerInitializedEvent. In my real application I do that to have access to the real port number of my service. In this demo, I simply assign "https://api.chucknorris.io/jokes" to the configuration property the FeignClient (ChuckNorrisApiClient) uses as URL.

As one can see in the startup logs, this value indeed gets assigned to the property. But although calling refreshScope.refreshAll(), the FeignClient annotated with @RefreshScope does not get refreshed.

When you assign "https://api.chucknorris.io/jokes" to the property client.api-url in application.yml, the client works as expected. (Note that I received a 403 Error (Access denied | api.chucknorris.io used Cloudflare to restrict access) in the past. Nevertheless, the correct URL got called.)

Expected behaviour

I would expect the FeignClient to reload upon config changes.