Spring Boot ignores Ordered on TemporalOptionsCustomizer beans

Offen
#3,244 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@Quinn-With-Two-Ns arbeitet bereits daran.

Seit 01.12.2026.

  • #3246 von @Quinn-With-Two-Ns — offen

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
30/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Veraltet
Tech-Stack
java, spring-boot
Bereich
backend

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Java
Sterne
447
Forks
278
Ø Merge
3 T. 22 Std.
Gemergte PRs (30 T.)
28

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus temporalio/sdk-java

Alle Issues in temporalio/sdk-java

Ähnliche Issues

Weitere Issues zu Java

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.