-
Notifications
You must be signed in to change notification settings - Fork 38.4k
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
Introduce proxy-based REST client similar to HttpInvokerProxyFactoryBean [SPR-12131] #16747
Comments
George Georgovassilis commented It's been a while now and there hasn't been any progress. Like I said back then, I have a running implementation which I'd happily adapt to Spring standards and conventions. Rossen, would you help me work on that? |
Rossen Stoyanchev commented Thanks the ping George Georgovassilis. We have a few related tickets and clearly something needs to be done but we need to make up our minds. I will need a little more time to respond more coherently. In the mean time can elaborate on what work may be required to adapt https://github.com/ggeorgovassilis/spring-rest-invoker above and beyond code style and conventions? |
George Georgovassilis commented Tests are flaky because they depend on recorded & replayed messages - I will have a look at how the other invokers are tested in Spring and work out a compatible solution. The *ProxyFactoryBeans I've seen extend UrlBasedRemoteAccessor - I need to understand the type hierarchy better; maybe the BaseRestInvokerProxyFactoryBean should extend HttpInvokerClientInterceptor, I'll need your help for sorting that out. Also, the returned objects seem to be instances of ProxyFactory instead of returning directly proxies - I'm unclear as to why and if that is necessary. Last not least, because of the dependency on MVC annotations, the REST exporter can't live in the web module but needs to move to the web-mvc module (or a separate module) |
Rossen Stoyanchev commented While I think this ticket is a worthwhile idea still for the time being I'm moving it into the 5.x backlog. It is more important to focus on completing the work on the reactive This is not on the critical path to 5.0 IMO because using the RestTemplate by comparison doesn't require that much code. Also there are alternatives even today. For example the Netflix Feign client is flexible enough to support different annotations and the Spring Cloud team have done that already. In fact I am wondering George Georgovassilis if you considered or would consider using Feign? If nothing else it reduces what you would have to write and maintain. There are also a few things I noticed while looking at your spring-rest-invoker. If we are to support #15682 which we are still considering then I'm not sure that it would make sense to use a syntax with multiple |
George Georgovassilis commented Since I submitted the ticket, my implementation received a few community contributions and is now available on maven central: https://github.com/ggeorgovassilis/spring-rest-invoker I still prefer it over the alternatives mentioned because of its fewer dependencies and tighter coupling to Spring semantics.
|
Superseded by #28386 |
George Georgovassilis opened SPR-12131 and commented
This ticket proposes a new component that will work similarly to HttpInvokerProxyFactoryBean and allows binding a java interface to a remote REST/JSON service. Annotations on the interface and its methods would define the mapping of method invocations to concrete HTTP requests to the REST service.
The component would be a proxy factory which is given the mapping (possibly via a class name) and returns proxies which pass method invocations to the remote REST service.
For a possible implementation see https://github.com/ggeorgovassilis/spring-rest-invoker
Affects: 4.0.6, 4.3.3
Reference URL: https://groups.google.com/forum/#!topic/spring-framework-contrib/HTja1bE1TWY
Issue Links:
@RequestMapping
without@Controller
registered as handler@RequestMapping
annotations as an interface for HTTP clients4 votes, 9 watchers
The text was updated successfully, but these errors were encountered: