Missing HTTP PATCH request method in Zuul RibbonRoutingFilter
Do you see any possibility that the RibbonRoutingFilter will support HTTP PATCH.
The problem is, that the enum Verb from com.netflix.client.http.HttpRequest don't support HTTP PATCH.
If it is not possible, perhaps it should be documented, which HTTP Verbs Ribbon & Zuul supports.
This issues is related to #307.
This is going to be a problem for me as well, since I'm using Spring Data REST, and use of the PATCH method is the documented way to update resources without having to supply a fully populated object.
This is coursing trouble to me too when one service want to update something in other service. Any way around this ?
We use ApacheHTTP as the client for ribbon. Dependencies need to be pushed.
<dependency>
<groupId>com.netflix.feign</groupId>
<artifactId>feign-httpclient</artifactId>
<version>8.3.0</version>
</dependency>
now you should be able to do sthg like. Don't use okhttp if you also want to use newrelic. No introspection there.
@Bean
public Client feignRibbonClient() {
return RibbonClient.builder().delegate(new ApacheHttpClient()).lbClientFactory(cachingLBClientFactory()).build();
}
@schoberwirt Where is the cachingLBClientFactory() coming from?
Ok, here is what I had to do to get a FeignClient implemenation to work. I haven't tested in a Zuul case yet, but it should be similar. And that is next on my plate.
I had to up-rev the following dependencies. Updated com.netflix.feign.{feign-core,feign-ribbon,feign-slf4j,feign-httpclient} to 8.5.0 I also had to add feign-httpclient to the dependencies. That then forced the need to update org.apache.httpcomponents to account for missing methods. So updated org.apache.httpcomponents.httpclient to 4.5 and updated apache.httpcomponents.httpcore to 4.4.1 (under the assumption that httpclient will work best with the latest httpcore.
Then I had to add the following to my Spring Application classes
@Bean
public Client feignRibbonClient() {
return RibbonClient.builder().delegate(new ApacheHttpClient()).build();
}
I let the RibbonClient use the default lbClientFactory instead of injecting my own. That allowed me to configure Feign to use Apache HTTP Client as the implementation, and thus get PATCH support.
Feign has been updated to 8.6.0, see #436
how would you all feel if com.netflix.feign:feign-httpclient was on the classpath to auto-configure its use, similar to how @zampettim has shown?
@spencergibb that would be awesome. +1.
See #442
#443 is the beginning of allowing http client in zuul
This all sounds great to me.
@zampettim I have tried with Zuul still the patch method does not work.Also I use 8.6.0 version of feign from Brixton.BUILD-SNAPSHOT of spring cloud.
@hrandika those things that @zampettim was showing relate only to feign, not to zuul. I'm in the middle of working on it in #443.
inadvertently closed
The groundwork has been laid in b494e1d.
Is there any progress in implementing a concrete RibbonCommand/Factory which can finally handle PATCH requests? The lack of this blocks our project which heavily depends on spring cloud concepts like zuul enabled frontends and spring-data-rest enabled resource services.
Otherwise i would implement it on my own but it is a bit difficult for me to understand what really happens there.
There is a RibbonLoadbalancer in org.springframework.cloud.netflix.feign.ribbon which seems to be useful as client for the RibbonCommand. But unfortunately it has package visible implementations of RibbonRequest and RibbonResponse as it was meant to be used only by Feign i doubt.
Should i create a new AbstractLoadBalancerAwareClient?
There has been no progress.
Is there any progress on this issue. what is a way around for this problem?
@dinkarthakur The change is available in Brixton M4 or snapshot, and you enable it by adding the following to a @Configuration class:
@Bean
public RibbonCommandFactory ribbonCommandFactory(SpringClientFactory clientFactory) {
return new HttpClientRibbonCommandFactory(clientFactory);
}
Still not able to make PATCH request