-
Notifications
You must be signed in to change notification settings - Fork 38k
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
Provide an memory efficient alternative to ClientHttpRequestInterceptor #22002
Comments
This would require a major overhaul of the interception mechanism, while we are winding down our development effort of I suggest closing as declined. What do you think, @rstoyanchev ? |
Yes I agree, and it helps that there is a workaround. |
Add `ClientHttpRequestInitializer` interface that can be used with any `HttpAccessor` to initialize each `ClientHttpRequest` before it's used. This provides a useful alternative to `ClientHttpRequestInterceptor` when users need to configure things like `HttpHeaders`. Closes spring-projectsgh-22002
Unfortunately the workaround that I suggested cannot work with I have a relatively small enhancement to I know it's quite late in the day to be asking for this, but could it be considered for 5.2? I can't really find any good solution using the existing interceptor mechanism that works in all situations. |
Looks good to me. Straight forward enough for 5.2. |
Phil Webb opened SPR-17470 and commented
See this issue for some background.
Currently the
BasicAuthenticationInterceptor
class is aClientHttpRequestInterceptor
which causes the entire body to be read into a byte array and can causeOutOfMemoryError
errors. I've managed to work around the issue by using a AbstractClientHttpRequestFactoryWrapper, but it would be really nice if there was a better way to do this. Perhaps we can create an alternativeClientHttpRequestInterceptor
that can be used when only headers need to be changed.Reference URL: spring-io/artifactory-resource#27
The text was updated successfully, but these errors were encountered: