-
Notifications
You must be signed in to change notification settings - Fork 161
Controllers implementing interfaces not mapped when the observability module is used #933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I will also include Java/Maven based minimal sample, the problem persists in it as well. |
This kind of works as designed. We use the default setup of An easy and recommended workaround is to consistently keep the annotations on the interface, if you decide to implement interfaces with the controller. I think for 1.4, we should move to pick up the proxying mechanism globally configured for the Spring Boot application (it already seems to default to class-based proxies), but it's too late to change that for 1.3. |
We now lookup the AbstractAutoProxyCreator registered for global proxy settings and apply that to the ProxyFactory used to create the proxies applying the observability decoration.
We now consider the global AOP proxying settings when applying the observability decoration. Please give the 1.4 snapshots a try! |
Thank you, tried 1.4.0-SNAPSHOT and the issue is indeed resolved. |
Thanks for the feedback and happy coding! 🙌 |
Description
When using Interface-Driven Controllers in a Spring project configured with
spring-web
,spring-modulith
, andspring-boot-actuator
, the controllers do not function as expected. The issue appears specifically when includingspring-modulith-observability
as a runtime dependency.For example, the following setup fails to work:
Reproducing the Issue
Here is a minimal sample to reproduce the issue:
demo.zip
When adding
runtimeOnly("org.springframework.modulith:spring-modulith-observability")
in the Gradle configuration, Interface-Driven Controllers fail to function. Removing this dependency allows the controllers to work as expected.Expected Behavior
The application should process requests to the
/api/hello
endpoint and return the providedtestText
parameter as expected.Observed Behavior
When
spring-modulith-observability
is included as a dependency, the endpoint does not work.The text was updated successfully, but these errors were encountered: