Skip to content

marinkobabic/NES

 
 

Repository files navigation

NES v4

NES (.NET Event Sourcing) is a lightweight framework that helps you build domain models when you're doing event sourcing.

What

If you're looking to take advantage of event sourcing on the .NET platform then you may also be looking to use NServiceBus and NEventStore. NES is an attempt to fill in the gaps between these two frameworks.

Why

The code required to bring NServiceBus and NEventStore together isn't hard to write but it is important and it does have to work a certain way to take full advantage of both frameworks. There's some great resources out there already that help you write this yourself but ideally you'd want to concentrate on developing your domain model's behaviour rather than the infrastructure to glue these two frameworks together.

How

NES hooks into NServiceBus' and NEventStore's configuration objects and transparently takes care of everything for you. All you have to do is add two extra lines to your application's initialisation code.

Project Goals

  • Allow processing of messages sent in a batch as a single transaction (Ref)
  • Allow use of interfaces for events (Ref)
  • Allow up-conversion of events (Ref @ 36:00)
  • Automatic persistence of message headers
  • Automatic publishing of persisted events
  • Convention based event handling within aggregates
  • No 'Save()' methods on repositories
  • Minimal configuration

Version History

v4

  • Supports NEventStore v4
  • Supports NServiceBus v4

v3

  • Supports EventStore v3
  • Supports NServiceBus v3

v2

  • Supports EventStore v3
  • Supports NServiceBus v2

v1

  • Supports EventStore v2
  • Supports NServiceBus v2

Download

The easiest way to install NES is via NuGet (NES, NES.NEventStore, NES.NEventStore.Raven, NES.NServiceBus) or you can download the source and run 'build.bat' from the command line. Once built, the files will be placed in the 'build' folder.

Using NES

public class EndpointConfig : IConfigureThisEndpoint, AsA_Publisher, IWantCustomInitialization
{
	public void Init()
	{
		NEventStore.Wireup.Init()
			.UsingSqlPersistence("EventStore")
			.InitializeStorageEngine()
			.NES()
			.UsingJsonSerialization()
			.Build();

		NServiceBus.Configure.With()
			.Log4Net()
			.DefaultBuilder()
			.JsonSerializer()
			.NES();
	}
}

For a more complete example, please open and build NES.Sample.sln in Visual Studio and hit F5. This will start the NES.Sample NServiceBus endpoint as well as the NES.Sample.Web MVC3 website.

Need help? Found a bug? Have a question?

  • For guidance on how to use NES please take a look at the wiki pages.
  • If you have any problems using NES please submit a new issue.
  • Ask your question on Stack Overflow and tag your question with the CQRS tag and the word "NES" in the title.

About

.NET Event Sourcing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 96.2%
  • PowerShell 3.7%
  • Shell 0.1%