FluentRabbitMQ

The easiest way to use RabbitMq


Keywords
message_queuing, rabbitMq, c#
License
Apache-2.0
Install
Install-Package FluentRabbitMQ -Version 1.0.0-preview

Documentation

enter image description here

Fluent RabbitMQ

The easiest way to use RabbitMQ

Publish message

var publisher = new ConnectionFactory().ConnectTo("localhost").AndUseExchange("AExchangeName").OfType(ExchangeType.Direct).GetPublisher();
publisher.Send("A message").To("ARoutingKey");
publisher.Send("Another message").To("AnotherRoutingKey");

Receive message

var receiver = new ConnectionFactory().ConnectTo("localhost").AndUseExchange("AExchangeName").OfType(ExchangeType.Direct).GetReceiver();
receiver.WhenMessageFrom("ARoutingKey").Do((model, ea) => Console.WriteLine(" [x] Received {0}", ea.BodyAsString()));
receiver.WhenMessageFrom("AnotherRoutingKey").Do((model, ea) => Console.WriteLine(" [y] Received {0}", ea.BodyAsString()));

Contributing

Feel free to open an issue.