https://github.com/easynetq/easynetq
An easy to use .NET API for RabbitMQ
https://github.com/easynetq/easynetq
dotnet dotnet-core messaging rabbitmq
Last synced: 5 months ago
JSON representation
An easy to use .NET API for RabbitMQ
- Host: GitHub
- URL: https://github.com/easynetq/easynetq
- Owner: EasyNetQ
- License: mit
- Created: 2011-04-21T15:47:20.000Z (about 15 years ago)
- Default Branch: master
- Last Pushed: 2025-04-01T03:23:04.000Z (over 1 year ago)
- Last Synced: 2025-04-22T16:56:40.968Z (about 1 year ago)
- Topics: dotnet, dotnet-core, messaging, rabbitmq
- Language: C#
- Homepage: http://easynetq.com
- Size: 68.7 MB
- Stars: 2,951
- Watchers: 158
- Forks: 753
- Open Issues: 89
-
Metadata Files:
- Readme: README.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
[](https://github.com/EasyNetQ/EasyNetQ/actions?query=workflow%3ACI)
[](https://www.nuget.org/packages/EasyNetQ)
[](https://www.nuget.org/packages/EasyNetQ/absoluteLatest)
[](https://www.nuget.org/packages/EasyNetQ)



--

A Nice .NET API for RabbitMQ
Initial development was sponsored by travel industry experts [15below](http://15below.com/)
* **[Homepage](http://easynetq.com)**
* **[Documentation](https://github.com/EasyNetQ/EasyNetQ/wiki/Introduction)**
* **[NuGet](http://www.nuget.org/packages/EasyNetQ)**
* **[Discussions](https://github.com/EasyNetQ/EasyNetQ/discussions)**
* **[~Old Discussion Group~](https://groups.google.com/group/easynetq)**
Goals:
### Important Update
With the release of EasyNetQ v8, the method for connecting to a RabbitMQ broker has changed. The rest of the API remains unchanged.
To make working with RabbitMQ on .NET as easy as possible.
To connect to a RabbitMQ broker in v7...
```c#
var bus = RabbitHutch.CreateBus("host=localhost");
```
To connect to a RabbitMQ broker in v8...
```c#
var serviceCollection = new ServiceCollection();
serviceCollection.AddEasyNetQ("host=localhost").UseSystemTextJson();
using var provider = serviceCollection.BuildServiceProvider();
var bus = provider.GetRequiredService();
```
To publish a message...
```c#
await bus.PubSub.PublishAsync(message);
```
To publish a message with a 5s delay...
```c#
await bus.Scheduler.FuturePublishAsync(message, TimeSpan.FromSeconds(5));
```
To subscribe to a message...
```c#
await bus.PubSub.SubscribeAsync(
"my_subscription_id", msg => Console.WriteLine(msg.Text)
);
```
Remote procedure call...
```c#
var request = new TestRequestMessage {Text = "Hello from the client! "};
await bus.Rpc.RequestAsync(request);
```
RPC server...
```c#
await bus.Rpc.RespondAsync(request =>
new TestResponseMessage{ Text = request.Text + " all done!" }
);
```
## Getting started
Just open EasyNetQ.sln in your preferred IDE or code editor and build. All the required dependencies for the solution file to build the software are included.
## Contributors
Thanks to all the people who already contributed!