muoncore/newton

Remove SagaBus and replace with a Saga Registry

Closed this issue · 1 comments

Saga bus is used to explicitly start sagas. Given that sagas can be implicitly started via an event, this seems to be redundant as the implicit start is the expected and preferred model.

Remove the saga bus.

Instead, implement a registry that enables you to look up sagas by the id of the initialising event

based on this code internally

OrderRequestedEvent ev = new OrderRequestedEvent();
SagaCreated sagaCreated = sagaRepository.getSagasCreatedByEventId(ev.getId()).get(0);
SagaMonitor<DocumentId, TestSaga> monitor = sagaFactory.monitor(sagaCreated.getSagaId(), TestSaga.class);

Fixed in #50