We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feign.client.config.default.capabilities[0]=com.google.ACapability feign.client.config.default.capabilities[1]=com.google.BCapability
this config. code detail demo:
public class ACapability implements Capability { @Override public Logger enrich(Logger logger) { return new ALogger(logger); } } public class BCapability implements Capability { @Override public Logger enrich(CustomLogger logger) { return new BLogger(logger); } } public class ALogger extends feign.Logger { @Override protected Response logAndRebufferResponse(String configKey, Level logLevel, Response response, long elapsedTime) { // todo print message } } public class BLogger extends feign.Logger { @Override protected Response logAndRebufferResponse(String configKey, Level logLevel, Response response, long elapsedTime) { // todo print message } }
The only thing that will be effective is com.google.BCapability
The text was updated successfully, but these errors were encountered:
@ipanocloud This probably Spring Feign problem.
I wrote the following test and enrichment works as expected:
@Test void multipleCapabilitiesEnrichment() { Feign.Builder builder = Feign.builder() .logger(new Logger.JavaLogger(BaseBuilderTest.class)) .addCapability(new ACapability()) .addCapability(new BCapability()) .enrich(); assertThat(builder.logger).isInstanceOf(BLogger.class); assertThat(((BLogger) builder.logger).delegate).isInstanceOf(ALogger.class); assertThat(((ALogger) ((BLogger) builder.logger).delegate).delegate) .isInstanceOf(Logger.JavaLogger.class); } public class ACapability implements Capability { @Override public Logger enrich(Logger logger) { return new ALogger(logger); } } public class BCapability implements Capability { @Override public Logger enrich(Logger logger) { return new BLogger(logger); } } public class ALogger extends feign.Logger { Logger delegate; ALogger(Logger logger) { this.delegate = logger; } @Override protected void log(final String configKey, final String format, final Object... args) { // DO NOTHING } } public class BLogger extends feign.Logger { Logger delegate; BLogger(Logger logger) { this.delegate = logger; } @Override protected void log(final String configKey, final String format, final Object... args) { // DO NOTHING } }
Sorry, something went wrong.
No branches or pull requests
this config.
code detail demo:
The only thing that will be effective is com.google.BCapability
The text was updated successfully, but these errors were encountered: