Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save KennyEliasson/ecb81cdb23c03371f0be8e5afee90798 to your computer and use it in GitHub Desktop.
Save KennyEliasson/ecb81cdb23c03371f0be8e5afee90798 to your computer and use it in GitHub Desktop.
EasynetQ Nack strategy
public class Nack_And_Send_To_DLX : IConsumerErrorStrategy
{
public void Dispose()
{
}
public AckStrategy HandleConsumerError(ConsumerExecutionContext context, Exception exception)
{
return AckStrategies.NackWithoutRequeue;
}
public AckStrategy HandleConsumerCancelled(ConsumerExecutionContext context)
{
return AckStrategies.NackWithoutRequeue;
}
}
// To use it
RabbitHutch.CreateBus("<CONNECTION>", (reg) =>{
reg.Register<IConsumerErrorStrategy, Nack_And_Send_To_DLX>();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment