Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
25 lines (22 sloc)
787 Bytes
This file contains 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.Linq; | |
using System.Threading.Tasks; | |
using NServiceBus; | |
using NServiceBus.Logging; | |
using Shared; | |
using Shared.Messages; | |
namespace RegularReceiver.Handler | |
{ | |
public class SubmitOrderHandler : IHandleMessages<OrderSubmitted> | |
{ | |
readonly ILog log = LogManager.GetLogger<SubmitOrderHandler>(); | |
public async Task Handle(OrderSubmitted message, IMessageHandlerContext context) | |
{ | |
if (!Customers.GetPriorityCustomers().Contains(message.CustomerId)) | |
{ | |
log.Info($"Message received with CustomerId [{message.CustomerId}]"); | |
// Emulate a delay as if RegularReceiver is slower than StrategicReceiver | |
await Task.Delay(250); | |
} | |
} | |
} | |
} |