src/Miles.MassTransit/MessageDeduplication/MessageDeduplicationExtensions.cs
/// <summary>
/// The message is recorded to ensure it is processed only once.
/// On identifying a message as already processed the message is removed from the queue without doing any work.
/// This should be wrapped in an <see cref="ITransactionContext" /> to ensure the processing and recording
/// of the message are a single unit of work.
/// </summary>
/// <typeparam name="TContext">The type of the context.</typeparam>
/// <param name="configurator">The configurator.</param>
/// <param name="queueName">Unique identifier for the queue.</param>
/// <returns></returns>
/// <remarks>
/// This assumes a container will have registered itself as an <see cref="IServiceLocator" /> payload to
/// retrieve an <see cref="IConsumptionRecorder" /> instance that will work with the <see cref="ITransactionContext" />.
/// </remarks>
The message is recorded to ensure it is processed only once.
On identifying a message as already processed the message is removed from the queue without doing any work.
This should be wrapped in an  to ensure the processing and recording
of the message are a single unit of work.
The message is recorded to ensure it is processed only once . On identifying a message as already processed the message is removed from the queue without doing any work . This should be wrapped in an to ensure the processing and recording of the message are a single unit of work .
public static void UseMessageDeduplication<TContext>(this IPipeConfigurator<TContext> configurator, string queueName) where TContext : class, ConsumeContext
        {
            var spec = new MessageDeduplicationSpecification<TContext>(queueName);
            configurator.AddPipeSpecification(spec);
        }
public static void UseMessageDeduplication < TContext > ( this IPipeConfigurator < TContext > configurator , string queueName ) where TContext : class , ConsumeContext { var spec = new MessageDeduplicationSpecification < TContext > ( queueName ) ; configurator . AddPipeSpecification ( spec ) ; }
The message is recorded to ensure it is processed only once.
The message is recorded to ensure it is processed only once .
None
IPipeConfigurator<TContext>
this
queueName
string
Unique identifier for the queue.
Unique identifier for the queue .
configurator
None
typeparam
The type of the context.
The type of the context .
remarks
This assumes a container will have registered itself as an  payload to
retrieve an  instance that will work with the .
This assumes a container will have registered itself as an payload to retrieve an instance that will work with the .