Skip to content

Instantly share code, notes, and snippets.

@sayganov
sayganov / Startup.cs
Last active January 22, 2020 09:45
EventBus.RabbitMQ.Standard (Publisher)
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
...
var rabbitMqOptions = Configuration.GetSection("RabbitMq").Get<RabbitMqOptions>();
services.AddRabbitMqConnection(rabbitMqOptions);
services.AddRabbitMqRegistration(rabbitMqOptions);
@sayganov
sayganov / ItemCreatedIntegrationEventHandler.cs
Created January 16, 2020 18:55
EventBus.RabbitMQ.Standard
public class ItemCreatedIntegrationEventHandler : IIntegrationEventHandler<ItemCreatedIntegrationEvent>
{
public ItemCreatedIntegrationEventHandler()
{
}
public async Task Handle(ItemCreatedIntegrationEvent @event)
{
//Handle the ItemCreatedIntegrationEvent event here.
}
@sayganov
sayganov / ItemCreatedIntegrationEvent.cs
Created January 16, 2020 18:53
EventBus.RabbitMQ.Standard
public class ItemCreatedIntegrationEvent : IntegrationEvent
{
public string Title { get; set; }
public string Description { get; set; }
public ItemCreatedIntegrationEvent(string title, string description)
{
Title = title;
Description = description;
}
@sayganov
sayganov / appsettings.json
Last active May 25, 2021 10:46
EventBus.RabbitMQ.Standard
{
"RabbitMq": {
"BrokerName": "test_broker",
"QueueName": "test_queue_pub",
"RetryCount": "5",
"VirtualHost": "your_virtual_host",
"Username": "your_username",
"Password": "your_password",
"Host": "your_host",
"DispatchConsumersAsync": true