In addition to what cacaocow posted, if you are using a newer version of spring boot, you may need to include the following in your application properties file.
spring.jackson.serialization.FAIL_ON_EMPTY_BEANS=false
server.tomcat.relaxed-query-chars={,},[,]
The first prevents the crash from org.apache.guacamole.net.SimpleGuacamoleTunnel["socket"]-> org.apache.guacamole.protocol.ConfiguredGuacamoleSocket["reader"]
and the second allows the guacamole client to send query messages with {} and [] characters that are no longer supported by newer webservers.
It is actually quite simple. First implement the example servlet from the official manual
Then annotate the servlet class as @RestController (@Controller might work too) and then >override the handler method and set the url mapping.
@Override
@RequestMapping(path = "tunnel", method = { RequestMethod.POST, RequestMethod.GET })
protected void handleTunnelRequest(HttpServletRequest request,
HttpServletResponse response) throws ServletException {
super.handleTunnelRequest(request, response);
}
Then you can use the endpoint as described in the manual