コード例 #1
0
ファイル: Program.cs プロジェクト: mwinder/sample-rabbitmq
        static void Main(string[] args)
        {
            LogManager.Configuration = LoggingConfiguration();

            var bus = RabbitHutch.CreateBus("host=localhost");

            bus.Subscribe<PaymentSucceeded>("Consumer", message => log.Info(message));
            bus.Subscribe<PaymentFailed>("Consumer", message => log.Info(message));

            var trialStartedHandler = new TrialStartedHandler();
            bus.Subscribe<TrialStarted>("Consumer", trialStartedHandler.Handle);

            Console.WriteLine("Press ENTER to exit");
            Console.ReadLine();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: mwinder/sample-rabbitmq
        static void Main(string[] args)
        {
            LogManager.Configuration = LoggingConfiguration();

            var bus = RabbitHutch.CreateBus("host=localhost");

            bus.Subscribe <PaymentSucceeded>("Consumer", message => log.Info(message));
            bus.Subscribe <PaymentFailed>("Consumer", message => log.Info(message));

            var trialStartedHandler = new TrialStartedHandler();

            bus.Subscribe <TrialStarted>("Consumer", trialStartedHandler.Handle);

            Console.WriteLine("Press ENTER to exit");
            Console.ReadLine();
        }