dynamic message-mapping for websockets in Spring 4

前端 未结 2 1320
灰色年华
灰色年华 2021-02-06 14:59

I want to develop a small chat with springs new websocket/stomp support. I guess i cannot use something like this:

@MessageMapping(\"/connect/{roomId}\")
@SendTo         


        
相关标签:
2条回答
  • 2021-02-06 15:07

    Yes the @MessageMapping annotation (javaadoc) and the reference docs both list all supported arguments and return value types.

    0 讨论(0)
  • 2021-02-06 15:09

    Figured it out, you need to use @DestinationVariable instead of @PathVariable

    0 讨论(0)
提交回复
热议问题