I am new to RabbitMQ, I followed the Tutorial 6 on RPC as I need something similar but I don't quite like the idea of temporary queues that are destroyed after recieving the reply.
Documentation says:
"The client can declare a single-use queue for each request-response pair. But this is inefficient; even a transient unmirrored queue can be expensive to create and then delete (compared with the cost of sending a message).[...]
So alternatively the client can create a long-lived queue for its replies. But this can be fiddly to manage, especially if the client itself is not long-lived."
I am planning to have one durable rpc queue and one durable rpc reply queue. Client will be taking the messages and matching by looking at correlation id.
So I tried to create a long lived reply queue that won't be deleted and won't be auto generated, defining it as follows:
replyQueueName = channel.QueueDeclare(queue: "rpc-reply-queue",
durable: true,
exclusive: false,
autoDelete: false,
arguments: null).QueueName;
Is there anything wrong with such approach? What can happen if client is not long-lived? I tested it and it seems to be working fine. Just wanted to make sure there are no side effects to this approach.
Documentation suggests to use Direct Reply-to feature, what would be better? My approach seems to be easier but I am not sure if it's correct.
Thanks in advance.