I have, what I think to be, a very simple Spring WebSocket application. However, I\'m trying to use path variables for the subscription as well as the message mapping.
Actually I think this is what you might be looking for:
@Autorwired
lateinit var template: SimpMessageTemplate;
@MessageMapping("/class/{id}")
@Throws(Exception::class)
fun onOffer(@DestinationVariable("id") id: String?, @Payload msg: Message) {
println("RECEIVED " + id)
template.convertAndSend("/topic/class/$id", Message("The response"))
}
Hope this helps someone! :)