-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Description
Hi,
We recently upgraded our Feign client from version 12.5 to 13.5 and have encountered an issue post-upgrade. Specifically, the method public ResponseInterceptor enrich(ResponseInterceptor responseInterceptor)
within our custom capability is no longer being executed and hence the response interceptor is not getting used at all. This method was functioning as expected prior to the upgrade.
I suspect this has something to do with the changes introduced as part of supporting multiple ResponseInterceptors (#1829), but not sure. Please provide some insights or guidance on resolving this issue.
Attaching the code for reference:
@Slf4j
public class MyInterceptor implements ResponseInterceptor, Retryer {
@Override
public Object intercept(InvocationContext invocationContext, Chain chain) throws Exception {
try (Response ignored = invocationContext.response()) {
log.info("Inside intercept method of MyInterceptor");
return chain.next(invocationContext);
}
}
@Override
public void continueOrPropagate(RetryableException e) {
log.info("Inside continueOrPropagate method of MyInterceptor");
throw e;
}
@Override
public Retryer clone() {
return this;
}
}
public class MyCapability implements Capability {
private final MyInterceptor myInterceptor;
public MyCapability() {
this.myInterceptor = new MyInterceptor();
}
public ResponseInterceptor enrich(ResponseInterceptor responseInterceptor) {
return myInterceptor;
}
public Retryer enrich(Retryer retryer) {
return myInterceptor;
}
}
public class MyConfig {
@Bean
public MyCapability myCapability() {
return new MyCapability();
}
}
@FeignClient(name = "myClient", url = "${myUrl}", configuration = {MyConfig.class})
public interface PartyDetailsClient {
@PostMapping
MyResponse getPartyDetails(@RequestBody MyRequest myRequest);
}
Metadata
Metadata
Assignees
Labels
No labels