コード例 #1
0
        public async Task Apply(Channel channel)
        {
            if (LogAdapter.ExtendedLogEnabled)
            {
                LogAdapter.LogDebug("Recovery", "Recovering consumer " + _consumerTag + " for queue " + _queue);
            }

            if (_consumer2 != null)
            {
                await channel.BasicConsume(_mode, _consumer2, _queue, _consumerTag, _withoutAcks, _exclusive, _arguments, waitConfirmation : true).ConfigureAwait(false);

                _consumer2.Recovered();

                return;
            }

            await channel.BasicConsume(_mode, _consumer, _queue, _consumerTag, _withoutAcks, _exclusive, _arguments, waitConfirmation : true).ConfigureAwait(false);
        }
コード例 #2
0
        public async Task Apply(Channel channel, IDictionary <string, string> reservedNamesMapping)
        {
            var queueNameToUse =
                _queue.StartsWith(AmqpConstants.AmqpReservedPrefix, StringComparison.Ordinal) ? reservedNamesMapping[_queue] : _queue;

            if (LogAdapter.ExtendedLogEnabled)
            {
                LogAdapter.LogDebug("Recovery", "Recovering consumer " + _consumerTag + " for queue " + queueNameToUse);
            }

            if (_consumer2 != null)
            {
                await channel.BasicConsume(_mode, _consumer2, queueNameToUse, _consumerTag, _withoutAcks, _exclusive, _arguments, waitConfirmation : true).ConfigureAwait(false);

                _consumer2.Recovered();

                return;
            }

            await channel.BasicConsume(_mode, _consumer, queueNameToUse, _consumerTag, _withoutAcks, _exclusive, _arguments, waitConfirmation : true).ConfigureAwait(false);
        }