private void SetQosAndCreateConsumers() { if (!AcknowledgeMode.IsAutoAck() && !Cancelled) { // Set basicQos before calling basicConsume (otherwise if we are not acking the broker // will send blocks of 100 messages) try { Channel.BasicQos(0, PrefetchCount, true); } catch (Exception e) { ActiveObjectCounter.Release(this); throw new RabbitIOException(e); } } try { if (!Cancelled) { foreach (var queueName in Queues) { if (!MissingQueues.Contains(queueName)) { ConsumeFromQueue(queueName); } } } } catch (Exception e) { throw RabbitExceptionTranslator.ConvertRabbitAccessException(e); } }