MongolianBarbecue/Consumer.cs
/// <summary>
/// Acknowledges having processed the message with the given <paramref name="messageId"/>.
/// This will delete the message document from the underlying MongoDB collection.
/// </summary>
Acknowledges having processed the message with the given .
This will delete the message document from the underlying MongoDB collection.
Acknowledges having processed the message with the given . This will delete the message document from the underlying MongoDB collection .
public async Task Ack(string messageId)
        {
            var collection = _config.Collection;
            await _semaphore.WaitAsync();
            try
            {
                var deleteResult = await collection.DeleteOneAsync(doc => doc["_id"] == messageId);
            }
            finally
            {
                _semaphore.Release();
            }
        }
public async Task Ack ( string messageId ) { var collection = _config . Collection ; await _semaphore . WaitAsync ( ) ; try { var deleteResult = await collection . DeleteOneAsync ( doc => doc [ " " ] == messageId ) ; } finally { _semaphore . Release ( ) ; } }
Acknowledges having processed the message with the given .
Acknowledges having processed the message with the given .
messageId
string