Browse Source

Changing implementation to not get the actualEventBus if it is system-wide event.

pull/1240/head
espent1004 5 years ago
parent
commit
24949c2baf
1 changed files with 8 additions and 5 deletions
  1. +8
    -5
      src/BuildingBlocks/EventBus/EventBusRabbitMQ/MultiEventBusRabbitMQ.cs

+ 8
- 5
src/BuildingBlocks/EventBus/EventBusRabbitMQ/MultiEventBusRabbitMQ.cs View File

@ -30,12 +30,15 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ
eventBus.Publish(@event); eventBus.Publish(@event);
}); });
} }
//TODO requires ALL events to have tenantId set!
_tenants.TryGetValue(@event.TenantId, out String tenantName);
var actualEventBus = _eventBuses.Find(e => e.GetVHost().Equals(tenantName));
else
{
//TODO requires ALL events to have tenantId set!
_tenants.TryGetValue(@event.TenantId, out String tenantName);
var actualEventBus = _eventBuses.Find(e => e.GetVHost().Equals(tenantName));
actualEventBus.Publish(@event);
}
actualEventBus.Publish(@event);
} }
public void Subscribe<T, TH>() where T : IntegrationEvent where TH : IIntegrationEventHandler<T> public void Subscribe<T, TH>() where T : IntegrationEvent where TH : IIntegrationEventHandler<T>


Loading…
Cancel
Save