Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rafaelfgx/MessageBrokerService
MessageBrokerService (RabbitMQ).
https://github.com/rafaelfgx/MessageBrokerService
dot-net dot-net-core dotnet dotnet-core dotnetcore message-broker message-queue rabbitmq
Last synced: 7 days ago
JSON representation
MessageBrokerService (RabbitMQ).
- Host: GitHub
- URL: https://github.com/rafaelfgx/MessageBrokerService
- Owner: rafaelfgx
- License: mit
- Created: 2018-07-12T15:49:19.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2024-11-12T21:58:23.000Z (8 days ago)
- Last Synced: 2024-11-12T22:31:25.296Z (8 days ago)
- Topics: dot-net, dot-net-core, dotnet, dotnet-core, dotnetcore, message-broker, message-queue, rabbitmq
- Language: C#
- Homepage:
- Size: 4.88 KB
- Stars: 23
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
# MessageBrokerService
[RabbitMQ](https://www.rabbitmq.com)
## IProductQueue
```csharp
public interface IProductQueue : IQueue { }
```## ProductQueue
```csharp
public class ProductQueue : Queue, IProductQueue { }
```## Publisher
```csharp
public static class Publisher
{
public static void Main()
{
Console.WriteLine(nameof(Publisher).ToUpper());while (true)
{
Console.Write("Enter the product name: ");var name = Console.ReadLine();
var product = new Product { Name = name };
IProductQueue productQueue = new ProductQueue();
productQueue.Publish(product);
}
}
}
```## Subscriber
```csharp
public static class Subscriber
{
public static void Main()
{
Console.WriteLine(nameof(Subscriber).ToUpper());IProductQueue productQueue = new ProductQueue();
productQueue.Subscribe((product) => Console.WriteLine(product.Name));
Console.ReadLine();
}
}
```