コード例 #1
0
ファイル: Core.cs プロジェクト: zilveer/Exchange-7
 private void QueueConsumer()
 {
     try
     {
         _queueConsumer.Consume(OnMessage);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
         throw;
     }
 }
コード例 #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello I'm Bank Consumer");
            var factory = new ConnectionFactory
            {
                Uri = new Uri("amqp://*****:*****@localhost:5672")
            };

            using var connection = factory.CreateConnection();
            using var channel    = connection.CreateModel();
            QueueConsumer.Consume(channel);
        }
コード例 #3
0
        public 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();
            QueueConsumer.Consume(channel);

            CreateHostBuilder(args).Build().Run();
        }
コード例 #4
0
        static void Main(string[] args)
        {
            serialPort.DataFromArduinoHandler += DataFromArduinoEventHandler;


            var factory = new ConnectionFactory
            {
                Uri = rabbitMqConfigs.Uri//new Uri("amqp://*****:*****@localhost:5672")
            };

            connection = factory.CreateConnection();
            channel    = connection.CreateModel();
            QueueConsumer.Consume(channel, serialPort);
            Console.ReadLine();
        }
コード例 #5
0
        public ConsumeResult <string, string> Consume(int millisecondsTimeout)
        {
            var response = consumer.Consume(Subscription, millisecondsTimeout);

            if (response != default)
            {
                return(new ConsumeResult <string, string>
                {
                    Topic = response.topic,
                    Message = new Message <string, string>
                    {
                        Key = response.topic,
                        Value = response.message
                    }
                });
            }
            return(default);
コード例 #6
0
ファイル: EventListener.cs プロジェクト: 355gts/CovidStandard
 public async Task Run()
 {
     // tell the consumer to start listening and then pass it the process message action to perform
     _queueConsumer.Consume(ProcessMessageAsync);
 }