My web page has a WebSocket connection with STOMP protocol.
I was wondering if I can use this channel with STOMP to send synchronous requests, like to an Ajax call (I know Ajax is considered asynchronous, but I meant it send the request and waits for the answer).
I tried to use STOMP messages, but I cannot easily link requests and responses.
My web page has a WebSocket connection with STOMP protocol.
I was wondering if I can use this channel with STOMP to send synchronous requests, like to an Ajax call (I know Ajax is considered asynchronous, but I meant it send the request and waits for the answer).
I tried to use STOMP messages, but I cannot easily link requests and responses.
Share Improve this question edited Mar 21 at 1:07 Justin Bertram 35.5k6 gold badges26 silver badges49 bronze badges asked Mar 20 at 21:33 TobiaTobia 9,57329 gold badges120 silver badges242 bronze badges1 Answer
Reset to default 1This is a pretty generic question so I'm going to give a pretty generic answer. This is not a "how to."
You can use STOMP in a request-reply pattern to mimic what you get with Ajax.
You can link requests and responses together using a correlation ID.
The specifics here will really depend on the message broker you use, but generally speaking the STOMP protocol is flexible enough to support your use-case.