The missing event-driven framework for .NET
Contains a high-level abstraction for the following EIP patterns
Contains implementation based on MassTransit. Sample code is using RabbitMq transport.
var endpoint = new RabbitMqEndpointBuilder()
.WithContainerConfigurator(new AutofacContainerConfigurator(containerBuilder))
.WithMessageTypeTopology("Test_Application_Name")
.WithTopologyFeaturesConfiguration(new DefaultRabbitMqTopologyFeaturesConfiguration())
.Build();
public sealed class TestMessagingModule : MessagingModule
{
protected override void Load(IMessagingModuleBuilder builder)
{
// Query
builder.WithHandler<TestQueryHandler>();
// Command
builder.WithHandler<TestCommandHandler>();
// Event
builder.WithHandler<TestEventHandler>();
// Sagas
builder.WithSaga<TestSaga>();
}
}
endpoint.RegisterMessagingModule(new TestMessagingModule());
endpoint.Configure();
var messageBus = endpoint.CreateMessageBus();
// Query (fetch, direct, p2p)
await messageBus.RequestAsync(new TestQuery()).ConfigureAwait(false);
// Command (execute, direct/broadcast)
await messageBus.SendAsync(new TestCommand()).ConfigureAwait(false);
// Event (Pub-sub)
await messageBus.Publish(new TestEvent { OrderId = i }).ConfigureAwait(false);