Reputation: 4596
I have two queries that are sent one after the other. If I use send
method, than I get the response in onmessage
and I need to know which response it was - from the first query or from the second. Is it possible?
Upvotes: 0
Views: 692
Reputation: 35885
You should add a correlation id to each request, and return that id with the response, that way the client would know which response is associated with which request.
Since it is a client concern, the id can be a simple incremental integer, does not need to be a GUID or unique number. The server just have to attach the request id to the response, does not need to do anything with it.
Upvotes: 1