Sync-Async boundary

exactly-once.github.io

Why asynchronous?

Why does adding an item take so long?

How do I deduplicate AddItem messages?

How do I deduplicate Submit messages?


public Task Handle(SendSubmit message,
	IMessageHandlingContext context)
{ 
	var cart = repository.Load(message.Id);
	if (cart.IsSubmitted)
	{
		log.Info("Duplicate");
		return;
	}
	cart.Submitted = true;
	context.Send(new Submit());
}
					

State machine deduplication

Sync


Async