コード例 #1
0
ファイル: Service1.cs プロジェクト: mnowak82/nginn-messagebus
 protected override void OnStop()
 {
     if (_host != null)
     {
         _host.StopMessageBus();
         _host.Container.Dispose();
         _host = null;
     }
 }
コード例 #2
0
        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();
        }
コード例 #3
0
 public static void Shutdown(IWindsorContainer wc)
 {
     MessageBusConfigurator.StopMessageBus(wc);
 }
コード例 #4
0
 void Application_End(object sender, EventArgs e)
 {
     mc.StopMessageBus();
 }