Пример #1
0
        private static void Queue_Receive()
        {
            var settings = RabbitMqSettings.ForQueue(
                hostname: "localhost",
                username: "******",
                password: "******",
                port: 5672,
                exchange: "e.direct",
                queue: "q.direct");

            IRabbitMqService <Message> receiver = new RabbitMqService <Message>(settings);

            receiver.Receive(
                message =>
            {
                Console.WriteLine(message.Text);
                return(MessageProcessResponse.Complete);
            },
                ex => Console.WriteLine(ex.Message),
                () => Console.WriteLine("Waiting..."));
        }