You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks I have found this immensely helpful, but one think I have not been able to do is add a second subscription to an event. It looks like this should be possible but is not. I may have misunderstood your intent.
This is how you register a handler with the IOC container. services.AddTransient<IIntegrationEventHandler<CarPricePerDayChangedIntegrationEvent>, CarPricePerDayChangedIntegrationEventHandler>();
If I want a second handler of the event in the same microservice for example a CarPricePerDayChangedAuditEventHandler then I can do this the same way: services.AddTransient<IIntegrationEventHandler<CarPricePerDayChangedAuditIntegrationEvent>, CarPricePerDayChangedAuditEventHandler>();
but when I go to set up the subscription I do not have the option of adding both handlers. the method looks like this. eventBus.SubscribeAsync<CarPricePerDayChangedIntegrationEvent, IIntegrationEventHandler<CarPricePerDayChangedIntegrationEvent>>().GetAwaiter().GetResult();
It seems that what ever we specify last will likely get created by the IOC container.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Thanks I have found this immensely helpful, but one think I have not been able to do is add a second subscription to an event. It looks like this should be possible but is not. I may have misunderstood your intent.
This is how you register a handler with the IOC container.
services.AddTransient<IIntegrationEventHandler<CarPricePerDayChangedIntegrationEvent>, CarPricePerDayChangedIntegrationEventHandler>();
If I want a second handler of the event in the same microservice for example a
CarPricePerDayChangedAuditEventHandler
then I can do this the same way:services.AddTransient<IIntegrationEventHandler<CarPricePerDayChangedAuditIntegrationEvent>, CarPricePerDayChangedAuditEventHandler>();
but when I go to set up the subscription I do not have the option of adding both handlers. the method looks like this.
eventBus.SubscribeAsync<CarPricePerDayChangedIntegrationEvent, IIntegrationEventHandler<CarPricePerDayChangedIntegrationEvent>>().GetAwaiter().GetResult();
It seems that what ever we specify last will likely get created by the IOC container.
Beta Was this translation helpful? Give feedback.
All reactions