-
Notifications
You must be signed in to change notification settings - Fork 618
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
Introduce annotation for removing functional beans from being considered for function registry #418
Comments
Huh? Why not Annotations are not so flexible as configuration properties. You can have them conditionally in different environments, but with annotations you are stuck with compile time condition and nothing you can do afterwards. That is an opinion in regards conditional features in the project. As @olegz explained in the #417 this not for production to rely on the auto-discovery. It is really recommended to use You may miss the fact that However I see in docs something like this So, sounds like this issue is Duplicate 😉 |
@elefeint we actually did discuss it - the disabling part, but decided to opt out with that
|
@artembilan the |
@artembilan the reason for annotation over configuration is that, in my mind, configuration is for user applications. At that level, the user application might as well specify the opt-in This issue and #417 are ideas and options. The outcome needs to be whatever makes the most sense for the Spring Cloud Function/Spring Cloud Stream direction... On Spring Cloud GCP, we can work around the issue locally. |
I think between spring-cloud/spring-cloud-stream#1865 and few previous commits that indirectly addressed this issue, there is not much that needs to be done at the moment, at least in the scope of spring-cloud-function. In other words, the actual issue was that other frameworks hat have dependency on spring-cloud-function but had no intention on using it were being affected by its presence. For example spring-cloud-stream which at the moment supports two programming models. So if anything these type of cases must be handled by such frameworks and in the case of spring-cloud-stream it has been. |
Consider introducing a new annotation,
@DisableFunctionalAutodiscovery
, that autoconfiguration providers could use to prevent infrastructural functional beans from being surfaced in the function registry.Function autodiscovery is very convenient for user applications, but could lead to surprising behavior, in which Spring Cloud Function autodiscovery stops working when an unrelated dependency is added to the project. Spring projects that introduce conflicting autoconfiguration are best positioned to exclude the problematic beans by pulling Spring Cloud Function as a compile-time dependency and adding the
@DisableFunctionalAutodiscovery
annotation. And we'd love to keep developers from spending time on unnecessary troubleshooting caused by our projects 😩 .Related issues: #409, #417, spring-attic/spring-cloud-gcp#1997.
The text was updated successfully, but these errors were encountered: