-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
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
Low-level HTTP calls with Retrofit adapters #3750
Comments
Any updates here? I'm willing to make a PR for this feature, or if you can suggest a proper workaround, I'd be happy :) |
Kind semi-year reminder :D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What kind of issue is this?
already exists! Don’t send pull requests to implement new features without first getting our
support. Sometimes we leave features out on purpose to keep the project small.
So we were implementing the fault-tolerance system for our Android application based on storing the low-level request data in SQLite and process the stored requests in a background. After consideration we came to the point where we will only store the method, url and body of the request, relying on our interceptors to add the API/Auth tokens.
We do not want to store the data that will rely on our code, so it is not okay for us to use the retrofit annotated API-services and instead we require low-level calls, such as:
It does the thing and it works correctly with all the interceptors that enrich the request with the tokens. However, we also use retrofit-specific CallAdapters we run into the issue. In our case we only use the Retry policy from
resilience4j.retrofit
and it is being bootstrapped byRetrofit.Builder().addCallAdapterFactory(RetryCallAdapter.of(apiRetry))
. So when we call thecallFactory()
it returns the OkHttp low-level call factory that is oblivious to any call adapters that we have. It is not the biggest deal and we work it around withBut of course it only looks okay-ish because we only use one call adapter, and, for example, no CircuitBreaker so far.
So the problem is - is there a way to make a low-level calls to the whole retrofit instance without using the annotated service? Is it a proper feature request?
Thanks in advance,
Best regards :)
The text was updated successfully, but these errors were encountered: