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 DeduplicationCleanup : IWantToRunWhenTheBusStarts | |
| { | |
| public InMemoryPersistence MemoryPersistence { get; set; } | |
| public void Run() | |
| { | |
| Schedule.Every(TimeSpan.FromMinutes(1)) | |
| //delete all ID's older than 30 minutes | |
| .Action(()=> MemoryPersistence.DeleteDeliveredMessages(DateTime.UtcNow.AddMinutes(-30))); | |
| } | |
| } |
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 DeduplicationCleanup : IWantToRunWhenTheBusStarts | |
| { | |
| public InMemoryPersistence MemoryPersistence { get; set; } | |
| public void Run() | |
| { | |
| Schedule.Every(TimeSpan.FromMinutes(1)) | |
| //delete all ID's older than 30 minutes | |
| .Action(()=> MemoryPersistence.DeleteDeliveredMessages(DateTime.UtcNow.AddMinutes(30))); | |
| } | |
| } |
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 ShippingPolicy : Saga<ShippingPolicyData>, | |
| IAmStartedByMessages<OrderAccepted>, | |
| IHandleMessages<OrderBilled> | |
| { | |
| public void Handle(OrderAccepted message) | |
| { | |
| Data.OrderId = message.OrderId; | |
| Data.Accepted = true; | |
| DispatchOrder(); | |
| } |
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
| if(tm.Headers["NServiceBus.ExceptionInfo.ExceptionType"] == typeof(MyBusinessException).FullName) | |
| return TimeSpan.MinValue; |
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 ChangeRetryPolicy : INeedInitialization | |
| { | |
| public void Init() | |
| { | |
| SecondLevelRetries.RetryPolicy = (tm) => | |
| { | |
| // retry max 3 times | |
| if (TransportMessageHelpers.GetNumberOfRetries(tm) >= 3) | |
| { | |
| // To send back a value less than zero tells the |
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
| namespace NServiceBus.Config | |
| { | |
| /// <summary> | |
| /// Configuration class for Endpoint attributes. | |
| /// </summary> | |
| public class Endpoint : IContainRuntimeSettings | |
| { | |
| /// <summary> | |
| /// Requests that queues will be created as Volatile (non-transactional) hence sending and receiving will be outside a transaction | |
| /// </summary> |
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
| <configSections> | |
| <section name="MessageForwardingInCaseOfFaultConfig" | |
| type="NServiceBus.Config.MessageForwardingInCaseOfFaultConfig, NServiceBus.Core" /> | |
| </configSections> | |
| <MessageForwardingInCaseOfFaultConfig ErrorQueue="error"/> |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Web.Http.Dependencies; | |
| using NServiceBus; | |
| using NServiceBus.ObjectBuilder; | |
| public class NServiceBusDependencyResolverAdapter : IDependencyResolver | |
| { | |
| readonly IBuilder builder; | |
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
| using System; | |
| using System.Linq; | |
| using System.Web.Http; | |
| using System.Web.Mvc; | |
| using NServiceBus; | |
| public static class ConfigureWeAPiDependencyInjection | |
| { | |
| public static Configure ForWebApi(this Configure configure) | |
| { |
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 GatewayWorkaroundMutator:IMutateOutgoingTransportMessages,INeedInitialization | |
| { | |
| public void MutateOutgoing(object[] messages, TransportMessage transportMessage) | |
| { | |
| if (transportMessage.CorrelationId == null) | |
| transportMessage.CorrelationId = ""; | |
| } | |
| public void Init() | |
| { |