Skip to content

Remove some Feign dependencies#3427

Open
pkoenig10 wants to merge 1 commit intodevelopfrom
pkoenig/feign
Open

Remove some Feign dependencies#3427
pkoenig10 wants to merge 1 commit intodevelopfrom
pkoenig/feign

Conversation

@pkoenig10
Copy link
Copy Markdown
Member

conjure-java-runtime has a dependency on an old, unmaintained version of Feign. This is causing classpath conflicts with consumers are using a modern version of Feign, as the package has changed to io.github.openfeign:feign-core and the library has gone through a couple major version changes.

This PR is a small first step that eliminates our Feign dependency in a couple places where it is no longer needed.

After this PR, conjure-java-jaxrs-client is the only project that still has a Feign dependency. In a follow-up, I'd like to fork and vendor Feign as a private implementation detail of this project.

Comment on lines -136 to -139
// Assert that timeouts are in milliseconds, not any higher precision, because feign only supports millis.
checkTimeoutPrecision(connectTimeout(), "connectTimeout");
checkTimeoutPrecision(readTimeout(), "readTimeout");
checkTimeoutPrecision(writeTimeout(), "writeTimeout");
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no longer relevant. Since #1596 we no longer use these values to configure the Feign Options. We no longer use the default Feign client (which respects these options) and instead use our Dialogue-based client, which ignores them (because this is handled by the underlying Dialogue client).

public feign.Response execute(Request request, Request.Options _options) throws IOException {

// Exception mappers
context.register(new NoContentExceptionMapper());
context.register(new IllegalArgumentExceptionMapper(exceptionListener));
context.register(new RetryableExceptionMapper(exceptionListener));
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't providing any value. Without this, these errors will just get handled by RuntimeExceptionMapper, which has identical behavior.

Not to mention that:

  • Most client errors should be handled inside the Dialogue client and not make it to the Feign wrapper where they may be wrapped in RetryableExceptionMapper.
  • We have relatively few endpoint that still use Jersey.

Comment on lines -260 to -261
// Note that Feign overrides OkHttp timeouts with the timeouts given in FeignBuilder#Options if given, or
// with its own default otherwise.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer correct, for the reason mentioned above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant