diff --git a/Tapeti/Connection/TapetiClient.cs b/Tapeti/Connection/TapetiClient.cs index fba46b8..9f68728 100644 --- a/Tapeti/Connection/TapetiClient.cs +++ b/Tapeti/Connection/TapetiClient.cs @@ -820,7 +820,7 @@ namespace Tapeti.Connection } if (connectionParams.PrefetchCount > 0) - capturedPublishChannelModel.BasicQos(0, connectionParams.PrefetchCount, false); + capturedConsumeChannelModel.BasicQos(0, connectionParams.PrefetchCount, false); capturedPublishChannelModel.ModelShutdown += (_, e) => { diff --git a/Tapeti/Connection/TapetiSubscriber.cs b/Tapeti/Connection/TapetiSubscriber.cs index 3b92262..c8133cc 100644 --- a/Tapeti/Connection/TapetiSubscriber.cs +++ b/Tapeti/Connection/TapetiSubscriber.cs @@ -143,13 +143,13 @@ namespace Tapeti.Connection { var queues = config.Bindings.GroupBy(binding => binding.QueueName); - consumerTags.AddRange(await Task.WhenAll(queues.Select(async group => + consumerTags.AddRange((await Task.WhenAll(queues.Select(async group => { var queueName = group.Key; var consumer = new TapetiConsumer(cancellationToken, config, queueName, group); return await clientFactory().Consume(cancellationToken, queueName, consumer); - }))); + }))).Where(t => t != null)); }