mayuanyang / Mediator.Net.Middlewares.EventStore

Middleware for Mediator.Net to write event to GetEventStore

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build status Mediator.Net on Stack Overflow

Mediator.Net.Middlewares.EventStore

Middleware for Mediator.Net to write event to GetEventStore, it is a Middleware for Mediator.Net that plugs intothe publish pipeline

Setup

Create a BusBuilder as normal and add this middleware by using .ConfigurePublishPipe

var bus = builder.RegisterHandlers(typeof(Program).Assembly)
  .ConfigurePublishPipe(x =>
        {
            // Add this middleware into the PublishPipe
            x.UseEventStore(new EventStoreService());
        }).Build();
   
   // Send the command, any event that being raised by the behavior triggered by 
   // this command will then be sent to EventStore
   await bus.SendAsync(new SimpleCommand());
                

Configuration

Add the following settings into you app/web.config

<appSettings>
    <add key="EventStore.IpAddress" value="127.0.0.1"/>
    <add key="EventStore.Port" value="1113"/>
    <add key="EventStore.StreamName" value="Whatever"/>
    <add key="EventStore.StreamVersion" value="1"/>
</appSettings>

About

Middleware for Mediator.Net to write event to GetEventStore

License:Apache License 2.0


Languages

Language:C# 100.0%