From 7b05def8efe539181fa254a2512f980069c0b2be Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Thu, 14 Aug 2014 17:53:53 +0400 Subject: [PATCH] Make RPC client response queues auto-delete and exclusive Patch by Witeman Zheng. --- src/amqp_rpc_client.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/amqp_rpc_client.erl b/src/amqp_rpc_client.erl index a192b6b1..6f8a2273 100644 --- a/src/amqp_rpc_client.erl +++ b/src/amqp_rpc_client.erl @@ -88,7 +88,8 @@ call(RpcClient, Payload) -> %% Sets up a reply queue for this client to listen on setup_reply_queue(State = #state{channel = Channel}) -> #'queue.declare_ok'{queue = Q} = - amqp_channel:call(Channel, #'queue.declare'{}), + amqp_channel:call(Channel, #'queue.declare'{exclusive = true, + auto_delete = true}), State#state{reply_queue = Q}. %% Registers this RPC client instance as a consumer to handle rpc responses