Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        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();
        }