Home > Net >  Is it possible to have a MassTransit Saga react to events that come from more that one bus (multibus
Is it possible to have a MassTransit Saga react to events that come from more that one bus (multibus

Time:10-23

I have a MassTransit Saga that works great with events, activites etc. in the context of the bus (Azure Service Bus) for which saga has been configured.

During one of the states I need to send a message to a different bus (another Azure Service Bus). That works fine using MultiBus. But, during next step I would like to receive a topic message from that separate bus and react to it.

Is that supported atm in MassTransit Saga?

CodePudding user response:

Yes, you can configure the same saga on multiple bus instances using the same saga repository. You can add the repository separately with the AddSagaRepository<T> method, to avoid having to configure it twice.

You would need to call AddSagaStateMachine within each AddMassTransit block.

  • Related