Skip to content

This is the core Shuttle.Esb repository and the assembly is always referenced.

License

Notifications You must be signed in to change notification settings

iraychen/Shuttle.Esb

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shuttle.Esb

A highly flexible and free .NET open-source enterprise service bus.

Documentation

There is extensive documentation on our site and you can make use of the samples to get you going.

Overview

Send a command message for processing

using (var bus = ServiceBus.Create().Start())
{
	bus.Send(new RegisterMemberCommand
	{
		UserName = "Mr Resistor",
		EMailAddress = "ohm@resistor.domain"
	});
}

Publish an event message when something interesting happens

using (var bus = ServiceBus.Create(c => c.SubscriptionManager(SubscriptionManager.Default())).Start())
{
	bus.Publish(new MemberRegisteredEvent
	{
		UserName = "Mr Resistor"
	});
}

Subscribe to those interesting events

SubscriptionManager.Default().Subscribe<MemberRegisteredEvent>();

Handle any messages

public class RegisterMemberHandler : IMessageHandler<RegisterMemberCommand>
{
	public void ProcessMessage(IHandlerContext<RegisterMemberCommand> context)
	{
		Console.WriteLine();
		Console.WriteLine("[MEMBER REGISTERED] : user name = '{0}'", context.Message.UserName);
		Console.WriteLine();

		context.Publish(new MemberRegisteredEvent
		{
			UserName = context.Message.UserName
		});
	}

	public bool IsReusable
	{
		get { return true; }
	}
}
public class MemberRegisteredHandler : IMessageHandler<MemberRegisteredEvent>
{
	public void ProcessMessage(IHandlerContext<MemberRegisteredEvent> context)
	{
		Console.WriteLine();
		Console.WriteLine("[EVENT RECEIVED] : user name = '{0}'", context.Message.UserName);
		Console.WriteLine();
	}

	public bool IsReusable
	{
		get { return true; }
	}
}

About

This is the core Shuttle.Esb repository and the assembly is always referenced.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%