You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Spring MVC REST: Provide interface definition model for generating HTTP client interface proxies wrapping RestTemplates [SPR-6261] #10929
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.
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.
Activity
spring-projects-issues commentedon Oct 22, 2009
Alex Antonov commented
As an example of what an interface would look like:
@ServiceRequestannotation would indicate to the invocation handler what HTTP call you are going to make.@ParamNameis similar to@RequestParam&@PathVariablefrom MVCThose 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-projects-issues commentedon Jul 4, 2016
Marten Deinum commented
I guess this is what Netflix Feign already provides on the plain Spring MVC annotations.
spring-projects-issues commentedon 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.