Skip to content

Enhancing Apache HttpClient 5 / Http2Client / OkHttpClient configuration in Spring Cloud OpenFeign #887

@ernest-gonzales

Description

@ernest-gonzales

With the removal of support for Apache HttpClient 4 in the recent commit (d30540d), the Spring Cloud OpenFeign project has transitioned to using Apache HttpClient 5 for its HTTP client functionality. As a result, an Apache HttpClient 5 client bean is now automatically generated when the class ApacheHttp5Client.class is present on the classpath. This enhancement was achieved by introducing matchIfMissing = true on the property condition, for example here.

To maintain alignment between the codebase and documentation, changes have to be done in the documentation files: spring-cloud-openfeign.adoc and additional-spring-configuration-metadata.json.

It's important to note that, as of this update, only the Apache HttpClient 5 client is automatically enabled if the necessary class is detected on the classpath. The other two clients, Http2Client and OkHttpClient, require explicit configuration for enabling. It might be beneficial to review the usage of matchIfMissing = true for the spring.cloud.openfeign.httpclient.hc5.enabled property condition to ensure consistency.

Furthermore, we've identified inconsistent behavior related to the other two clients. Instances such as this and this indicate that property values do not necessarily have to be set to true to satisfy the associated conditions.

This observation encourages us to review and potentially revise the usage of matchIfMissing = true across various property conditions, ensuring a cohesive and intuitive configuration experience.

Thank you for considering these suggestions and improvements.

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions