Esempio n. 1
0
        public async Task Execute()
        {
            var bus = _busConfig.ConfigureBus((cfg, host) =>
            {
                // procesing payment
                cfg.ReceiveEndpoint(host, nameof(IPaymentReceivedEvent), c =>
                {
                    c.Consumer(() => new CollectionPaymentConsumer(_messages));
                });

                // refund payment
                //cfg.ReceiveEndpoint(host, Queues.PaymentRefund, r =>
                //{
                //    r.Consumer(() => new RefundPaymentConsumer(_messages));
                //});
            });

            await bus.StartAsync();

            Console.WriteLine("Payment service is online");
            Console.WriteLine(string.Empty);
            Console.ReadLine();

            await bus.StopAsync();
        }
        public async Task Execute()
        {
            var bus = _busConfig.ConfigureBus((cfg, host) =>
            {
                cfg.ReceiveEndpoint(host, Queues.Notifications, n =>
                {
                    n.Consumer <ReceiveMessageConsumer>();
                });
            });

            await bus.StartAsync();

            Console.WriteLine("Notification service is online");
            Console.ReadLine();

            await bus.StopAsync();
        }
Esempio n. 3
0
        public async Task Execute()
        {
            var bus = _busConfig.ConfigureBus((cfg, host) =>
            {
                // procesing payment
                cfg.ReceiveEndpoint(host, nameof(SubmitPayment), c =>
                {
                    c.StateMachineSaga(_paymentSaga, _repo);
                });
            });

            await bus.StartAsync();

            Console.WriteLine("Saga service is online");
            Console.WriteLine(string.Empty);
            Console.ReadLine();

            await bus.StopAsync();
        }