From 988c0a170939a0750de280d0632b5e6ea0d47500 Mon Sep 17 00:00:00 2001 From: Menno van Lavieren Date: Fri, 21 Jul 2017 14:14:19 +0200 Subject: [PATCH] Bug fix ReplyTo werkte niet op static queues --- Tapeti/Config/IConfig.cs | 2 +- Tapeti/Connection/TapetiWorker.cs | 8 +++++++- Tapeti/TapetiConfig.cs | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Tapeti/Config/IConfig.cs b/Tapeti/Config/IConfig.cs index 1b80950..a7cd268 100644 --- a/Tapeti/Config/IConfig.cs +++ b/Tapeti/Config/IConfig.cs @@ -47,7 +47,7 @@ namespace Tapeti.Config } - public interface IDynamicQueueBinding : IBinding + public interface IBuildBinding : IBinding { void SetQueueName(string queueName); } diff --git a/Tapeti/Connection/TapetiWorker.cs b/Tapeti/Connection/TapetiWorker.cs index 5046346..8b9f7d6 100644 --- a/Tapeti/Connection/TapetiWorker.cs +++ b/Tapeti/Connection/TapetiWorker.cs @@ -83,11 +83,17 @@ namespace Tapeti.Connection channel.QueueBind(dynamicQueue.QueueName, exchange, routingKey); } - (binding as IDynamicQueueBinding)?.SetQueueName(dynamicQueue.QueueName); + (binding as IBuildBinding)?.SetQueueName(dynamicQueue.QueueName); } } else + { channel.QueueDeclarePassive(queue.Name); + foreach (var binding in queue.Bindings) + { + (binding as IBuildBinding)?.SetQueueName(queue.Name); + } + } }).Unwrap(); } diff --git a/Tapeti/TapetiConfig.cs b/Tapeti/TapetiConfig.cs index 078e3c5..2832a8c 100644 --- a/Tapeti/TapetiConfig.cs +++ b/Tapeti/TapetiConfig.cs @@ -392,7 +392,7 @@ namespace Tapeti } - protected class Binding : IDynamicQueueBinding + protected class Binding : IBuildBinding { public Type Controller { get; set; } public MethodInfo Method { get; set; }