A highly configurable free open-source enterprise service bus that provides you with a mechanism to create Autonomous Business Components that are loosely coupled. This enables you to develop and deploy specific business functionality that can be independently versioned.
using (var bus = ServiceBus.Create().Start())
{
bus.Send(new RegisterMemberCommand
{
UserName = "Mr Resistor",
EMailAddress = "ohm@resistor.domain"
});
}
using (var bus = ServiceBus.Create(c => c.SubscriptionManager(SubscriptionManager.Default())).Start())
{
bus.Publish(new MemberRegisteredEvent
{
UserName = "Mr Resistor"
});
}
SubscriptionManager.Default().Subscribe<MemberRegisteredEvent>();
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 class MemberRegisteredHandler : IMessageHandler<MemberRegisteredEvent>
{
public void ProcessMessage(IHandlerContext<MemberRegisteredEvent> context)
{
Console.WriteLine();
Console.WriteLine("[EVENT RECEIVED] : user name = '{0}'", context.Message.UserName);
Console.WriteLine();
}
}