Confusing behaviour: empty URL not allowed with default Client, but possible with ApacheHttpClient
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ó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
Bắt đầu tại FeignClientFactoryBean.loadBalance và so sánh đường dẫn Client mặc định với bean ApacheHttpClient được đăng ký bởi FeignAutoConfiguration.HttpClientFeignConfiguration. Xác định hành vi dự kiến đối với một URL @FeignClient rỗng và ghi lại hoặc kiểm thử kết quả để cả hai cấu hình đều có kết quả rõ ràng, nhất quán.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
My issue is related to https://github.com/spring-cloud/spring-cloud-openfeign/issues/517.
I found after some debugging that contrary to the situation described in that ticket, if ApacheHttpClient is on the classpath (in my case through a dependency on io.github.openfeign:feign-httpclient), it is very well possible to specify an empty String for the url in a @FeignClient (in my case, I did it like this: @FeignClient(name = "myfeignclient", url = "${my.url:}"), i.e. with an empty String as default value and the property being absent).
This allows the context to come up at least and will only result in an UnknownHostException when a request is actually attempted to be sent through that FeignClient.
For us, this is quite convenient though in a development environment where the destination is not known or when working on someone else's project so not all the required configuration needs to be known.
The crucial difference seems to be in the method loadBalance in FeignClientFactoryBean. Without the ApacheHttpClient being available as a bean, getOptional returns null, leading to the IllegalStateException.
A bean of type ApacheHttpClient seemingly becomes registered through FeignAutoConfiguration.HttpClientFeignConfiguration.
I'm thinking that if the Client.Default implementation was exposed as a bean, both situations would behave the same.
Would this be a reasonable change? I read @OlgaMaciaszek's point on the other ticket that it is intended to fail(?) by design, but why should it work then with ApacheHttpClient? (please don't take away that possibility though, like I said above, we like it 😉)
- Ngôn ngữ chính
- Java
- Star
- 1.3k
- Fork
- 834
- Merge trung bình
- 3 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 14
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của spring-cloud/spring-cloud-openfeign
-
@RequestHeader overrides @PathVariable with the same nameCó thể làm lại được @rajeshvasa đã nhận 11 ngày trước và không có pull request nào đang mở. Đang mởwaiting-for-triage
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 64/100
spring-cloud/spring-cloud-openfeign#1465 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
question
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
spring-cloud/spring-cloud-openfeign#1392 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
FeignClientsConfiguration$MicrometerConfiguration.class cannot be opened because it does not existĐang mởfeedback-provided
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
spring-cloud/spring-cloud-openfeign#1379 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
waiting-for-triage
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
spring-cloud/spring-cloud-openfeign#1340 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
dependencies
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
spring-cloud/spring-cloud-openfeign#1334 · 11 bình luận · 4 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của spring-cloud/spring-cloud-openfeign
Issue tương tự
-
Add contributing guideCó thể đã có người làm @WadekarPrashant đã nhận hôm nay. Đang mởgood first issue
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
jenkinsci/gitea-checks-plugin#382 · 1 bình luận ·
-
enhancement infra
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 1 ngày
-
5.0.x backport bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
spring-cloud/spring-cloud-function#1569 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Move the spring-cloud-commons version and BOM import from the bus parent to the stream parentCó thể đã có người làm @olegz đã nhận hôm nay. Đang mởtask
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
spring-cloud/spring-cloud-stream#3355 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
opensearch-project/opensearch-java#2342 ·
Maintainer thường phản hồi trong vòng 1 ngày