Last active
January 1, 2016 08:29
-
-
Save kijanawoodard/8118380 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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