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

This commit is contained in:
espent1004 2020-02-05 22:17:46 +01:00
parent 748a0596d3
commit 24949c2baf

View File

@ -30,12 +30,15 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ
eventBus.Publish(@event);
});
}
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));
//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>