Exemplo n.º 1
0
        static void Main()
        {
            var connection = RabbitConnectionSingleton.Get();
            var channel    = connection.CreateModel();

            AlertsExchangeFactory.DeclareAlertsExhange(channel);
            var criticalQueueName  = QueueDeclarer.DeclareQueueCritical(channel);
            var rateLimitQueueName = QueueDeclarer.DeclareQueueRateLimit(channel);

            channel.BasicConsume(
                criticalQueueName,
                autoAck: false,
                consumer: new CriticalQueueConsumer(channel),
                consumerTag: "critical"
                );
            channel.BasicConsume(
                rateLimitQueueName,
                autoAck: false,
                consumer: new RateLimitQueueConsumer(channel),
                consumerTag: "rate_limit");

            Console.WriteLine("Ready for alerts!");
        }
Exemplo n.º 2
0
 private static void EnsureExchangeAndQueues(IModel channel)
 {
     AlertsExchangeFactory.DeclareAlertsExhange(channel);
     QueueDeclarer.DeclareQueueRateLimit(channel);
     QueueDeclarer.DeclareQueueCritical(channel);
 }