Describe the bug When we set the customized queryMapEncoder in Feign.Builder in Feign configuration class which works in 2.2.6.RELEASE as below
@Bean
public Feign.Builder feignBuilder(Retryer retryer) {
Feign.Builder builder = Feign.builder()
.retryer(retryer)
.queryMapEncoder(this::encodeQueryMap)
.invocationHandlerFactory(FeignApiInvocationHandler::new);
return builder;
}
and the "org.springframework.data.domain.Pageable" class also exists in classpath, the PageableSpringQueryMapEncoder will override the customized queryMapEncoder set in Feign.Builder. Unless, we define an additional QueryMapEncoder bean as below:
@Bean
public QueryMapEncoder queryMapEncoder() {
return this.queryMapEncoder();
}
@Bean
public Feign.Builder feignBuilder(Retryer retryer) {
return Feign.builder()
.retryer(retryer)
.queryMapEncoder(this::encodeQueryMap)
.invocationHandlerFactory(FeignApiInvocationHandler::new);
}
Maybe below code is the cause, it will use the "PageableSpringQueryMapEncoder" or the additional QueryMapEncoder bean, but not the one set in Feign.Builder
In FeignClientFactoryBean
protected void configureUsingConfiguration(FeignContext context,
Feign.Builder builder) {
...
QueryMapEncoder queryMapEncoder = getInheritedAwareOptional(context,
QueryMapEncoder.class);
if (queryMapEncoder != null) {
builder.queryMapEncoder(queryMapEncoder);
}
...
}
Please help to take a look. Thanks!
Sample
Comment From: OlgaMaciaszek
Hello, @camuel327 2.2.8.x is no longer supported. The supported lines are 3.1.x and 4.0.x. Please let me know if the issue is present in the supported releases.
Comment From: spring-cloud-issues
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Comment From: spring-cloud-issues
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.
Comment From: johnnico233
Hello, @camuel327
2.2.8.xis no longer supported. The supported lines are3.1.xand4.0.x. Please let me know if the issue is present in the supported releases.
this problem still appears in spring cloud 2022.0.5
Comment From: OlgaMaciaszek
Hello, @johnnico233. At this point, the only Spring Cloud release train with OSS support is 2023.0.x. Please verify against 2023.0.1. If the issue persists, please provide a minimal, complete, verifiable example that reproduces the issue.
Comment From: spring-cloud-issues
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Comment From: spring-cloud-issues
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.