rabbot
rabbot copied to clipboard
Timing: request calls
There's an issue with the request
.
Say you want to create a fresh connection and make your request, you might run into timing issues related to the replyQueue.
Upon connection creation, the replyQueue will be created (and bound) as well. Unfortunately, this event is not waited on - the addConnection
call resolved as soon as a connection is created.
So when you make a request right after that you might run into a timing issue that you subscribe after the handler (server) already sent an answer.
Due to the nature of replyQueue, this message would be lost forever.
The fix for this seems easy to implement; in the topology, you gotta wait for the replyQueue.ready
event from the queue. For even better safety, you should send the replyQueue.ready
event, when you bound the queue.