Spring Boot ignores Ordered on TemporalOptionsCustomizer beans

Aperta
#3,244 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Quinn-With-Two-Ns ci sta già lavorando.

Dal 1/12/2026.

  • #3246 di @Quinn-With-Two-Ns — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
java, spring-boot
Ambito
backend

Direzione di ricerca

Read AutoConfigurationUtils.chooseTemporalCustomizerBeans and its shared comparator, then inspect the tests for WorkflowClient, ScheduleClient, and ActivityClient options. Check how Ordered#getOrder(), @Order, @Priority, and @Bean method annotations are handled. Done means the repro customizers run in ascending order while annotation support continues to pass.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Expected Behavior

Spring Boot auto-configuration runs TemporalOptionsCustomizer beans in ascending Ordered#getOrder() order, regardless of bean registration order. TemporalOptionsCustomizer documents support for both Ordered and @Order.

Actual Behavior

When two customizers implement Ordered without annotations and are registered with order values 20 then 10, they run in registration order (20, 10) instead of order-value order (10, 20). Verified for root WorkflowClient, ScheduleClient, and ActivityClient options. The existing @Order test still passes.

AutoConfigurationUtils.chooseTemporalCustomizerBeans sorts map entries. Its comparator looks up @Order and @Priority on the underlying beans, but does not use Ordered#getOrder() on the customizer instances. The shared comparator should handle Ordered while preserving annotation support, including @Order on @Bean methods.

Steps to Reproduce the Problem

  1. Start an ApplicationContextRunner with Temporal's service stubs and root namespace auto-configurations and spring.temporal.connection.target=local.
  2. Register two beans implementing TemporalOptionsCustomizer<WorkflowClientOptions.Builder> and Ordered. Have each record its order value in a shared list from customize and return the builder unchanged. Register the bean with order 20 first, then the one with order 10; do not annotate either bean with @Order.
  3. Start the context and inspect the list: it is [20, 10], not [10, 20]. The same repro works with ScheduleClientOptions.Builder and, on #3157, ActivityClientOptions.Builder.

Specifications

  • Reproduced on #3157 (04f208e7) with Spring Boot 2.7.18. The same shared comparator is present on main (b9f92567).
  • Platform: macOS, JDK 21.

Reported in review of #3157. Follow-up to #2638 / #2649.

Lingua principale
Java
Stelle
447
Fork
278
Merge medio
3g 22h
PR unite (30g)
28

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di temporalio/sdk-java

Tutte le issue di temporalio/sdk-java

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.