private void QueueConsumer() { try { _queueConsumer.Consume(OnMessage); } catch (Exception ex) { Console.WriteLine(ex); throw; } }
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); }
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(); }
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(); }
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);
public async Task Run() { // tell the consumer to start listening and then pass it the process message action to perform _queueConsumer.Consume(ProcessMessageAsync); }