Skip to content

Instantly share code, notes, and snippets.

@kijanawoodard
Last active January 1, 2016 08:29
Show Gist options
  • Save kijanawoodard/8118380 to your computer and use it in GitHub Desktop.
Save kijanawoodard/8118380 to your computer and use it in GitHub Desktop.
namespace NServiceBus.Windsor.InMemory
{
using NServiceBus;
/*
This class configures this endpoint as a Server. More information about how to configure the NServiceBus host
can be found here: http://particular.net/articles/the-nservicebus-host
*/
public class EndpointConfig : IConfigureThisEndpoint, AsA_Server, IWantCustomInitialization
{
public void Init()
{
Configure.ScaleOut(_ => _.UseUniqueBrokerQueuePerMachine());
Configure.Serialization.Json();
Configure.Features
.Disable<Features.TimeoutManager>()
.Disable<Features.SecondLevelRetries>()
.Disable<Features.Sagas>()
.Disable<Features.Gateway>();
Configure.With()
//.DefaultBuilder()
.CastleWindsorBuilder()
.InMemorySubscriptionStorage()
.InMemoryFaultManagement()
.UnicastBus();
//Configure.Instance.Configurer.ConfigureComponent<Handler>(DependencyLifecycle.InstancePerCall);
}
}
public class Message : IEvent { }
public class Handler : IHandleMessages<Message>
{
public void Handle(Message message)
{
}
}
public class Go : IWantToRunWhenBusStartsAndStops
{
public IBus Bus { get; set; }
public void Start()
{
Bus.InMemory.Raise(new Message());
}
public void Stop()
{
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment