I am using Spring Websocket with STOMP, Simple Message Broker.
In my @Controller
I use method-level @SubscribeMapping
, which should subscribe the clien
I faced with the same problem, and finally switched to solution when I subscribe to both /topic
and /app
on a client, buffering everything received on /topic
handler until /app
-bound one will download all the chat history, that is what @SubscribeMapping
returns. Then I merge all recent chat entries with those received on a /topic
- there could be duplicates in my case.
Another working approach was to declare
registry.enableSimpleBroker("/app", "/topic");
registry.setApplicationDestinationPrefixes("/app", "/topic");
Obviously, not perfect. But worked :)