Пример #1
0
        public static void Main(string[] args)
        {
            //TODO: read from configuration / env variables configuration parameters
            var workerProcess = new WorkerProcess(new RabbitMQEventConsumer(host: "localdev", vhost: "/test", username: "******", password: "******"),
                                                  new SpotCharterEventSourceRepository("SpotCharters", "spot_user", "spot_user", host: "localdev"),
                                                  new SpotCharterQueryRepository("localdev", "spotService", username: "******", password: "******"));

            Task.WaitAll(Task.Factory.StartNew(() =>
            {
                Console.WriteLine("Consumer start waiting events from message broker.");
                workerProcess.Start("chartering.spot.viewupdate");
                while (Console.ReadLine() != "quit")
                {
                    ;
                }
                Console.WriteLine("Quitting consumer ...");
                workerProcess.Quit();
                Console.WriteLine("Closing");
            }));
        }