EasyNetQ 是 的 .NET 开发包。
示例代码:
var bus = RabbitHutch.CreateRabbitBus("localhost");var message = new MyMessage {Text = "Hello!"};bus.Publish(message);
GIT库:
https://github.com/EasyNetQ/EasyNetQ
Goals:
- To make working with RabbitMQ on .NET as easy as possible.
To connect to a RabbitMQ broker...
var bus = RabbitHutch.CreateBus("host=localhost");
To publish a message...
bus.Publish(message);
To subscribe to a message...
bus.Subscribe("my_subscription_id", msg => Console.WriteLine(msg.Text));
Remote procedure call...
var request = new TestRequestMessage {Text = "Hello from the client! "};bus.Request(request, response => Console.WriteLine("Got response: '{0}'", response.Text));
RPC server...
bus.Respond(request => new TestResponseMessage{ Text = request.Text + " all done!" });