Repository navigation
Honor Ordered on Spring Boot options customizers - #3246
Open
Quinn-With-Two-Ns wants to merge 2 commits into
Open
Quinn-With-Two-Ns wants to merge 2 commits into
Quinn-With-Two-Ns wants to merge 2 commits into
Conversation
Use the customizer instance as the fallback order source so Ordered beans run in ascending order without changing annotation precedence.
Use Spring’s annotation-aware comparator on the filtered customizer instances, with their bean definition metadata as an order source. This keeps namespace filtering intact and matches Spring list ordering when order sources overlap.
dplyukhin
approved these changes
Dec 2, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed?
Apply
TemporalOptionsCustomizerbeans using Spring's standard bean ordering, the same ordering used for injected interceptor lists. After filtering out named non-root customizers, sort the remaining bean instances with Spring'sAnnotationAwareOrderComparatorand bean definition metadata. This supportsPriorityOrdered,Ordered, and ordering annotations, including@Orderon@Beanmethods. Interceptor wiring and namespace selection are unchanged.Why?
Customizers are injected as a map so Temporal can filter by bean name. Unlike an injected list, that map is not sorted by Spring. Temporal's old comparator ignored
Ordered#getOrder()and resolved conflicting order declarations differently from Spring.Fixes #3244.
Breaking changes?
No API changes. Customizers that previously ran in registration order despite implementing
Ordered, or that relied on Temporal's old annotation precedence, may run in a different order. They now follow Spring's standard ordering rules.Server PR
Not needed.
Validation
20, 10instead of10, 20). Added a second regression test that compares actual customizer invocation order with Spring's ordered bean stream for mixedPriorityOrdered,Ordered, and@Orderdeclarations../gradlew --offline spotlessApplypassed.ActivityClientAutoConfigurationTestpassed on Spring Boot 3 and 4 using the project'sedgeDepsTestvariants.Note
Medium Risk
No API change, but customizers that depended on registration order or Temporal’s old annotation precedence may run in a different order when building client/worker options.
Overview
Spring Boot now runs
TemporalOptionsCustomizerbeans in the same order as an injectedList, instead of map registration order or Temporal’s former comparator.chooseTemporalCustomizerBeansstill filters non-root namespace customizers by bean name, but sorts the remainder withAnnotationAwareOrderComparatorandbeanOrderSources, which read bean-definitionorder, factory-method@Order, and target type metadata the way Spring does for list injection. That restoresPriorityOrderedvsOrderedsemantics and fixes customizers that implementOrdered#getOrder()but were previously ignored.JavaDoc on
TemporalOptionsCustomizerdocuments this behavior. New auto-configuration tests assert ascendingOrderedvalues and that invocation order matches Spring’sorderedStream()for mixed priority, class, and method ordering.Reviewed by Cursor Bugbot for commit 520b0b0. Bugbot is set up for automated code reviews on this repo. Configure here.