Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Question: Can ConfigurationPropertiesRebinder Refresh Be Aligned with @RefreshScope Behavior?

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

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

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
java, spring, spring-boot
Lĩnh vực
backend, cloud

Hướng nghiên cứu

Bắt đầu bằng cách đọc ConfigurationPropertiesRebinder và hành vi của @RefreshScope được mô tả trong issue, tập trung vào cách các giá trị cấu hình đã bị xóa và việc tạo lại bean được xử lý. Tiếp theo, lần theo các điểm vào hiện có của refresh và binding, rồi xác định và kiểm chứng hành vi mong muốn khi thay thế hoặc cập nhật bean ban đầu, bao gồm cả các lỗi của constructor và vòng đời.

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

Mô tả

waiting-for-triage

Is your feature request related to a problem? Please describe.
The ConfigurationPropertiesRebinder refresh mechanism works by performing destroy and initial processes on existing bean objects. During refresh, some property values may not be properly handled (for example, if certain configuration items are deleted, the corresponding property values are not cleared). To clear these property values, I need to add the @RefreshScope annotation and leverage its mechanism to refresh the inner bean. However, I am cautious about using the @RefreshScope annotation because its lazy loading and re-creation behavior may lead to bean retrieval failures or slowdowns (such as exceptions thrown in constructors or lifecycle methods).

Describe the solution you'd like
Is it possible to initialize a new bean during the ConfigurationPropertiesRebinder binding process and assign its values to the original bean? This would align the refresh behaviors of @RefreshScope and ConfigurationProperties.

Ngôn ngữ chính
Java
Star
751
Fork
745
Merge trung bình
2 ngày 2 giờ
Pull request đã merge (30 ngày)
27

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 spring-cloud/spring-cloud-commons

Tất cả issue của spring-cloud/spring-cloud-commons

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.