I am trying to use RestTemplate
with @EnableDiscoveryClient
which ends up calling the Ribbon Interceptor. Down the call stack, the following call ends up being made:
org.springframework.cloud.netflix.ribbon.RibbonClientHttpRequestFactory$
RibbonHttpRequest.getBodyInternal(RibbonClientHttpRequestFactory.java:105)
Now, here is the code of this getBodyInternal
method:
@Override
protected OutputStream getBodyInternal(HttpHeaders headers) throws IOException {
throw new RuntimeException("Not implemented");
}
My question is what cases lead to this not implemented method and how can I avoid that? I am using RestTemplate.postForLocation
. Is it a general assumption that this method should not be called with Ribbon interceptor?