Beispiel #1
0
 void Application_Start(object sender, EventArgs e)
 {
     this.mc = MessageBusConfigurator.Begin()
               .ConfigureFromAppConfig()
               .UseSqlSubscriptions()
               .FinishConfiguration()
               .StartMessageBus();
     MessageBus = mc.GetMessageBus();
 }
 void Application_Start(object sender, EventArgs e)
 {
     this.mc = MessageBusConfigurator.Begin()
         .ConfigureFromAppConfig()
         .UseSqlSubscriptions()
         .FinishConfiguration()
         .StartMessageBus();
     MessageBus = mc.GetMessageBus();
 }
Beispiel #3
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();
        }