Exemple #1
0
        static void Main(string[] args)
        {
            var factory = new ConnectionFactory
            {
                Uri = new Uri("amqp://*****:*****@localhost:5672")
            };

            using var connection = factory.CreateConnection();
            using var channel    = connection.CreateModel();
            FanoutExchangeConsumer.Consume(channel);
        }
        static void Main(string[] args)
        {
            var factory = new ConnectionFactory
            {
                Uri = new Uri("amqp://*****:*****@localhost:5672")
            };

            using var connection = factory.CreateConnection();
            using var channel    = connection.CreateModel();
            channel.QueueDeclare("demo-queue", durable: true, exclusive: false, autoDelete: false, arguments: null);

            FanoutExchangeConsumer.Consume(channel);
        }