Last active
May 7, 2018 14:15
-
-
Save KennyEliasson/ecb81cdb23c03371f0be8e5afee90798 to your computer and use it in GitHub Desktop.
EasynetQ Nack strategy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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