Skip to content
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

Spring MVC REST: Provide interface definition model for generating HTTP client interface proxies wrapping RestTemplates [SPR-6261] #10929

Closed
spring-issuemaster opened this issue Oct 22, 2009 · 3 comments

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented Oct 22, 2009

Alex Antonov opened SPR-6261 and commented

Provide interface definition model for generating HTTP client interface proxies wrapping RestTemplates.

Code implementation to follow.


Affects: 3.0 RC1

Issue Links:

  • #16747 Introduce proxy-based REST client similar to HttpInvokerProxyFactoryBean ("is duplicated by")
  • #10477 Spring REST @MVC: Add support for google Protocol Buffers resource representation format ("supersedes")

3 votes, 12 watchers

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Oct 22, 2009

Alex Antonov commented

As an example of what an interface would look like:

public interface ProtobufHotelSearchService {
    @ServiceRequest(name="hotel.id", method= HttpInvocationHandler.RequestMethod.GET, pattern = "/${id}")
    public HotelProtos.Hotel findHotelById(@ParamName("id") Long id);

    @ServiceRequest(name="hotel.search", method= HttpInvocationHandler.RequestMethod.GET)
    public HotelProtos.HotelList findHotels(@ParamName("search") String search,
                                            @ParamName("page") int page,
                                            @ParamName("size") int size);

    @ServiceRequest(name="hotel.update")
    public void updateHotels(HotelProtos.Hotel h);
}

@ServiceRequest annotation would indicate to the invocation handler what HTTP call you are going to make.
@ParamName is similar to @RequestParam & @PathVariable from MVC

Those then get processed by the invocation handler to determine what the URL should look like, what HTTP method (GET, PUT, etc) should be executed, etc... After all that is figured out, a delegate call to RestTemplate can be made to actually process the request.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Jul 4, 2016

Marten Deinum commented

I guess this is what Netflix Feign already provides on the plain Spring MVC annotations.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Sep 22, 2016

Rossen Stoyanchev commented

Yes indeed it is the same although a much older ticket. I will resolve it as superseded by the likes of #16827 and #16747 that are currently under consideration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.