You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Beans that are annotated with both @RefreshScope and @ControllerAdvice, and which are component-scanned (as opposed to explicit configuration) have their @ModelAttribute methods executed twice per incoming request, as opposed to once. One of the executions is via the proxy, the other is direct.
No idea, but I'd remove @RefreshScope from TestAdvice and move properties to a @ConfigurationProperties bean or some other bean that has @RefreshScope.
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
This is in 2.1.3.RELEASE, and Spring Boot 2.1.7.
Beans that are annotated with both @RefreshScope and @ControllerAdvice, and which are component-scanned (as opposed to explicit configuration) have their @ModelAttribute methods executed twice per incoming request, as opposed to once. One of the executions is via the proxy, the other is direct.
Simple example:
Requests to the controller log as so:
2019-08-20 14:05:07.237 INFO 5156 --- [nio-8080-exec-5] test.TestAdvice : advice method executed with testvalue
2019-08-20 14:05:07.237 INFO 5156 --- [nio-8080-exec-5] test.TestAdvice : advice method executed with testvalue
Remove the @RefreshScope, and they log just once.
The text was updated successfully, but these errors were encountered: