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; }