protected override void OnStop() { if (_host != null) { _host.StopMessageBus(); _host.Container.Dispose(); _host = null; } }
static void Main(string[] args) { NLog.Config.SimpleConfigurator.ConfigureForConsoleLogging(NLog.LogLevel.Warn); MessageBusConfigurator mc = ConfigureMessageBus("sql://MessageBus/MQ_Events_SubscriberTwo"); var bus = mc.GetMessageBus(); //we'll be receiving events through the message distributor! //string eventHub = "sql://MessageBus/MQ_EventHub"; string eventHub = "sql://MessageBus/MQ_Events"; bus.SubscribeAt(eventHub, typeof(Object)); Console.WriteLine("Subscribed at {0}", eventHub); Console.WriteLine("Subscriber two listening at {0}, press enter to exit...", bus.Endpoint); Console.ReadLine(); mc.StopMessageBus(); }
public static void Shutdown(IWindsorContainer wc) { MessageBusConfigurator.StopMessageBus(wc); }
void Application_End(object sender, EventArgs e) { mc.StopMessageBus(); }