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
The method GatewayRegistrations.AddGateway<TSubscription, TSubscriptionOptions, TProducer, TProduceOptions, TTransform> registers a GatewayHandler in the SubscriptionBuilder.
Since AddGateway passes the GatewayHandler to AddEventHandler as an IEventHandler, and AddEventHandler tries to register the handler in the service collection as a singleton, this means that only the first GatewayHandler is registered in the service collection. As a result, the first GatewayHandler (and its transformation) is used for all gateway subscriptions.
Yeah, that can actually be fixed the same way as event handlers and checkpoint stores are attached to subscriptions. The problem is that gateways DI integration is way less comprehensive than DI stuff for subs as it took me weeks to figure things out there. It definitely worth spending time and figure better DI support for gateways as well.
The method
GatewayRegistrations.AddGateway<TSubscription, TSubscriptionOptions, TProducer, TProduceOptions, TTransform>
registers aGatewayHandler
in theSubscriptionBuilder
.Since
AddGateway
passes theGatewayHandler
toAddEventHandler
as anIEventHandler
, andAddEventHandler
tries to register the handler in the service collection as a singleton, this means that only the first GatewayHandler is registered in the service collection. As a result, the first GatewayHandler (and its transformation) is used for all gateway subscriptions.eventuous/src/Gateway/src/Eventuous.Gateway/Registrations/GatewayRegistrations.cs
Lines 127 to 157 in ed2c62e
eventuous/src/Core/src/Eventuous.Subscriptions/Registrations/SubscriptionBuilder.cs
Lines 47 to 53 in ed2c62e
For example, if I register two gateway subscriptions:
then both subscriptions will use SellOrderTransformation.
The text was updated successfully, but these errors were encountered: