Spring Boot ignores Ordered on TemporalOptionsCustomizer beans

Đang mở
#3,244 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@Quinn-With-Two-Ns đang làm issue này rồi.

Từ ngày 1/12/2026.

  • #3246 của @Quinn-With-Two-Ns — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
30/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
java, spring-boot
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Java
Star
447
Fork
278
Merge trung bình
3 ngày 22 giờ
Pull request đã merge (30 ngày)
28

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của temporalio/sdk-java

Tất cả issue của temporalio/sdk-java

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.