Life Beyond Distributed Transactions: An Apostate's Implementation - Dispatching Example

Posts in this series: A Primer Document Coordination Document Example Dispatching Example Failures and Retries Failure Recovery Sagas Relational Resources Conclusion Sample code from this series In the last post, we looked at refactoring our documents to use messaging to communicate changes. We're still missing something, however - the dispatcher: Our dispatcher is the main component that facilitates document communication. For a given document, it needs to: Read messages out [Read More]

MediatR 5.1 Released

This release changes the default behavior of awaiting an enumerable of Task. Previous to this release, tasks where awaited using Task.WhenAll. This causes problems in a variety of environments and situations that expect sequential ordering. In this release, the default behavior for enumerables is to await in a foreach, for: Mediator.Publish RequestPreProcessorBehavior RequestPostProcessorBehavior You can override the Mediator.Publish behavior by overriding the virtual PublishCore method, while the [Read More]

Contoso University Examples with CQRS, MediatR, AutoMapper and more

I was a bit surprised yesterday to see Scott Hanselman's post on my Contoso University sample app. That application basically takes the traditional Contoso University sample applications (of which there have been many), and try to adapt it to how our "normal" ASP.NET applications are built. Mainly these applications serve as working examples for our own internal teams, so that when we spin up a new application, we have [Read More]

MediatR 5.0 Released

Another milestone for MediatR, I released 5.0 over the weekend. This release simplifies a number of interfaces and methods, but introduced some breaking changes along the way. The major change for MediatR in 5.0 is the combination of void requests to directly implement IRequest<Unit>. In 4.x: public interface IRequest<T> : IBaseRequest { } public interface IRequest : IBaseRequest { } And in 5.0: public interface IRequest& [Read More]

MediatR 4.0 Released

The last major release of MediatR brought a simplification in design. Instead of having several different IRequest types and IRequestHandler implementations with several flavors, MediatR would try at runtime to determine how a single IRequest should resolve to different IRequestHandler implementations (synchronous, async, async with a cancellation token). In practice, this proved problematic as not all containers support this sort of 'try-resolve' behavior. MediatR relied on try...catch to resolve, [Read More]