Confusing behaviour: empty URL not allowed with default Client, but possible with ApacheHttpClient
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
Línea de trabajo
Comience en FeignClientFactoryBean.loadBalance y compare la ruta del Client predeterminado con el bean ApacheHttpClient registrado por FeignAutoConfiguration.HttpClientFeignConfiguration. Determine el comportamiento previsto para una URL @FeignClient vacía y documente o pruebe el resultado para que ambas configuraciones tengan un resultado explícito y coherente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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 😉)
- Lenguaje dominante
- Java
- Estrellas
- 1.3k
- Forks
- 834
- Merge medio
- 3 d 6 h
- PR fusionados (30 d)
- 14
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de spring-cloud/spring-cloud-openfeign
-
@RequestHeader overrides @PathVariable with the same nameQuizá libre de nuevo @rajeshvasa la tomó hace 11 días y no hay ningún pull request abierto. Abiertowaiting-for-triage
Dificultad 3/5 1-2 días Aptitud para principiantes 64/100
spring-cloud/spring-cloud-openfeign#1465 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
question
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
spring-cloud/spring-cloud-openfeign#1392 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
FeignClientsConfiguration$MicrometerConfiguration.class cannot be opened because it does not existAbiertofeedback-provided
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
spring-cloud/spring-cloud-openfeign#1379 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
-
waiting-for-triage
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
spring-cloud/spring-cloud-openfeign#1340 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
dependencies
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
spring-cloud/spring-cloud-openfeign#1334 · 11 comentarios · 4 reacciones ·
Los mantenedores suelen responder en 1 día
Todos los issues de spring-cloud/spring-cloud-openfeign
Issues similares
-
Add contributing guidePosiblemente ocupada @WadekarPrashant la tomó hoy. Abiertogood first issue
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
jenkinsci/gitea-checks-plugin#382 · 1 comentario ·
-
enhancement infra
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Los mantenedores suelen responder en 1 día
-
5.0.x backport bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
spring-cloud/spring-cloud-function#1569 ·
Los mantenedores suelen responder en 1 día
-
Move the spring-cloud-commons version and BOM import from the bus parent to the stream parentPosiblemente ocupada @olegz la tomó hoy. Abiertotask
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
spring-cloud/spring-cloud-stream#3355 ·
Los mantenedores suelen responder en 1 día
-
bug untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
opensearch-project/opensearch-java#2342 ·
Los mantenedores suelen responder en 1 día