What Priority means in Jakarta? #8
Replies: 6 comments 27 replies
-
The |
Beta Was this translation helpful? Give feedback.
-
In Jakarta REST, the Spec says:
For the request the lower the number the higher the priority. It has the following consequences:
|
Beta Was this translation helpful? Give feedback.
-
Here's a breakdown of a specific setup with servlet, but without Application created
|
Beta Was this translation helpful? Give feedback.
-
The root question behind all this priority and ordinal talk is: will Jakarta Config require a total (not partial) order of configuration value sources within an application? It seems like that's what |
Beta Was this translation helpful? Give feedback.
-
We could probably unpin this now? |
Beta Was this translation helpful? Give feedback.
-
Unpinning. |
Beta Was this translation helpful? Give feedback.
-
Further to last week's discussion, I spent a bit more time looking at the usage in CDI and try to recall what we discussed in the past regarding priority understanding. For priority used for overwrite reasons, such as converter and configsources.
We mainly discussed the invocation order for interceptors etc. No example was found on overwrite purpose as we used in Config.
I did further digging and found in CDI spec, the following explains clearly that highest priority wins.
https://jakarta.ee/specifications/cdi/3.0/jakarta-cdi-spec-3.0.html#unsatisfied_and_ambig_dependencies
All the beans left are alternatives with a priority, or producer methods or fields of beans that are alternatives with a priority, then the container will determine the highest priority value, and eliminate all beans, except for alternatives with the highest priority and producer methods and fields of alternatives with the highest priority value. If there is exactly one bean remaining, the container will select this bean, and the ambiguous dependency is called resolvable.
The above sentence clearly says the highest priority wins. MP Config priority is consistent with this behaviour.
Beta Was this translation helpful? Give feedback.
All reactions