Use rabbitmq direct reply-to for RPC calls #69
Replies: 5 comments 16 replies
-
|
@bodograumann thanks for notice that
It is exactly how RabbitMQ implements Direct Reply-To feature.
Queues, declared as |
Beta Was this translation helpful? Give feedback.
-
|
Wait: you can't use |
Beta Was this translation helpful? Give feedback.
-
|
Also, please do not use RPC to testing. It's a production feature. |
Beta Was this translation helpful? Give feedback.
-
|
@bodograumann thanks for your help. RPC over MQ become better by you. |
Beta Was this translation helpful? Give feedback.
-
|
Well, now we have another problem: miltiple consuming from reply_to is forbidden. So, RPC request is blocked by another request... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The use case of RPC over MQ is very interesting, especially for testing purposes.
Looking at the code, it seems a dedicated reply queue is created for each request.
I think that we can avoid that by using an existing reply queue or (at least for RabbitMQ) by using the Direct Reply-To feature.
Implementing it should be simple.
broker.publishalready accepts areply_toargument and it is currently applied to the message.Now if both
callback=Trueandreply_toare set, we could avoid creating a dedicated reply queue and use the one fromreply_to.In particular
broker.publish(queue=…, callback=True, reply_to="amq.rabbitmq.reply-to")would be using the Direct Reply-To feature of RabbitMQ.At the moment, when using
callbackandreply_toat the same time, the latter would override the former, but propan would still be waiting for a reply on the anonymous reply queue it created internally. So the reply can never be received in this situation.I also noticed that the
callback_queueis currently not deleted. This should probably be added as well, when it is created internally. (When given by the user viareply_toit should be kept of course.amq.rabbitmq.reply-toisn't even a real queue and cannot be deleted.)Beta Was this translation helpful? Give feedback.
All reactions