Add Support for properties and @NonBinding in javax.inject.Qualifier annotations #4769
Labels
status: pr submitted
A pull request has been submitted for the issue
Milestone
I am trying to use a custom @qualifier annotation which itself contains qualifying elements/properties together with InjectionPoint. Although the respective
@Bean
definition looks almost exactly the same, the observed behavior, however, is different from Spring Framework. It is actually quite contrary.Micronaut is ignoring any elements/properties of the Qualifier annotation in determining the proper
@Bean
method. For instance the following (very contrived) code in Spring would work but fails in Micronaut:I wonder if Micronaut could be aligned more closely with CDI in that regard and not only consider properties but also the @NonBinding annotation to provide comprehensive qualifier support.
Ideally, it would be desirable if also Spring and Micronaut would align in this regards as the targeted functionality is de facto identical. For reference please see 2 issues I have created against Spring Framework:
Add Support for @NonBinding in javax.inject.Qualifier annotations
spring-projects/spring-framework#26302
Add ability to ignore certain Qualifier Annotations using CustomAutowireConfigurer
spring-projects/spring-framework#26305
It certainly does not help the matter that
@nonbinding
is not part of JSR-330 (Dependency Injection for Java). Rather it is part of JSR-299 (Java Contexts and Dependency Injection).This issue might be related to issue CDI Alignment Tasks.
For further reference:
Java EE JavaDoc - Annotation Type Nonbinding
https://javaee.github.io/javaee-spec/javadocs/javax/enterprise/util/Nonbinding.html
Advanced Using @Nonbinding to combine a configuration annotation and a qualifier annotation into one annotation
https://dzone.com/articles/cdi-di-p2
The text was updated successfully, but these errors were encountered: