-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Description
Since the update of Feign to version 8.6.0 now it's possible to have whole interface hierarchies used as a clients.
I was trying to facilitate this idea in a form:
public interface CrudClient<T> {
@RequestMapping(method = RequestMethod.POST, value = "/")
long save(T entity);
@RequestMapping(method = RequestMethod.PUT, value = "/{id}")
void update(@PathVariable("id") long id, T entity);
@RequestMapping(method = RequestMethod.GET, value = "/{id}")
T get(@PathVariable("id") long id);
@RequestMapping(method = RequestMethod.DELETE, value = "/{id}")
void delete(@PathVariable("id") long id);
}
The only problem with this approach is that you will have to alter the specific paths for the concreate clients. The only supported way at the moment is to specify the explicit url like. 'http://localhost/users'
But it would be awaseome if it would be possible to do that with enabled Eureka discovery and Ribbon load balancing. Through one of the possible syntaxes:
@FeignClient("localapp/users")
public interface UsersClient extends CrudClient<User> {
}
or
@FeignClient("localapp")
@RequestMapping(value = "/users")
public interface UsersClient extends CrudClient<User> {
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels