Here’s a controller I’m trying to replace:
@RequestMapping("/user")
public @ResponseBody UserRsp callUserService(Principal principal) {
String authenticatedUsername = principal.getName();
return userService.getUser(authenticatedUsername);
}
I’d like to replace it with an int-http:inbound-gateway that’s mapped to a service adapter. I can’t find any documentation on this, but what I’d like to do is something like this:
<int-http:inbound-gateway
request-channel="requests"
reply-channel="replies"
path="/user"
view-name="/user"
payload-expression="#payload.principal.name"
supported-methods="GET"/>
But payload.principal is something I made up. Any ideas on the right way to do this?
Assuming you are using Spring Security, something like this should work…