
IServiceBusHost host = cfg.Host(SendEndpointUri, h =>Ĭfg.ReceiveEndpoint(host, ec => ) Var retryPolicy = new ExponentialRetryPolicy(new AllPolicyExceptionFilter(), a, TimeSpan.FromSeconds(b), TimeSpan.FromSeconds(c),TimeSpan.FromSeconds(d)) needs this to enable MassTransit to reschedule the delivery of messages In my case, I am using Azure Service Bus, so here is how we set up our global level retries: (cfg => There is a number of extension methods to help you set the retry polices based on the underlying transport you are using (RabbitMQ, Azure Service Bus, etc). This is the global setting that you set when you create your transport channels and should be part of your global bus settings. Similarly in MassTransit, there are basically 2 main approaches out-of-the-box to handle retrial: First Level Retry (Global Retry Policy) In NServiceBus, the coin the terms First Level Error Handling, and Second Level Retry. The design of MassTransit’s approach to handling errors seems to be influenced by NServiceBus way of handling errors. So what’s going to happen when message fails to be consumed properly? Should it be retried, should it be ignored, etc. One would hope that it would not happen often, but it would happen :). Let’s face it, things are going to fail, and bad things happen.



Message-based communication is a reliable and scalable way to implement a service oriented architecture. MassTransit provides an extensive set of features on top existing message transports, resulting in a developer friendly way to asynchronously connect services using message-based conversation patterns. MassTransit is a free, open source, lightweight message bus for creating distributed applications using the. It’s an awesome, open-source framework for delivering messages. MassTransit approach for handling errors | Has AlTaiar Has AlTaiar Rambling of an old man on software, life, and stuff Home On Twitter On LinkedIn About Has Contact Has MassTransit approach for handling errors
