@Test public void skipSagaEndedEvent_IfGlobalTxAlreadyFailed() { String localTxId1 = UUID.randomUUID().toString(); events.add(eventOf(SagaStartedEvent, localTxId1)); events.add(eventOf(TxAbortedEvent, localTxId1)); TxEvent event = eventOf(SagaEndedEvent, localTxId1); consistentService.handle(event); assertThat(events.size(), is(2)); }
public boolean handle(TxEvent event) { return true; }
TxConsistentService { public boolean handle(TxEvent event) { return true; } }
TxConsistentService { public boolean handle(TxEvent event) { return true; } TxConsistentService(TxEventRepository eventRepository, CommandRepository commandRepository, TxTimeoutRepository timeoutRepository); }
TxConsistentService { public boolean handle(TxEvent event) { return true; } TxConsistentService(TxEventRepository eventRepository, CommandRepository commandRepository, TxTimeoutRepository timeoutRepository); boolean handle(TxEvent event); int handleSupportTxPause(TxEvent event); Set<String> fetchLocalTxIdOfEndedGlobalTx(Set<String> localTxIdSet); boolean saveKafkaMessage(KafkaMessage message); boolean registerGlobalTx(TxEvent event); boolean registerSubTx(TxEvent subTxEvent, TxEventAddition subTxEventAddition); boolean checkIsExistsEventType(String globalTxId, String localTxId, String type); }
TxConsistentService { public boolean handle(TxEvent event) { return true; } TxConsistentService(TxEventRepository eventRepository, CommandRepository commandRepository, TxTimeoutRepository timeoutRepository); boolean handle(TxEvent event); int handleSupportTxPause(TxEvent event); Set<String> fetchLocalTxIdOfEndedGlobalTx(Set<String> localTxIdSet); boolean saveKafkaMessage(KafkaMessage message); boolean registerGlobalTx(TxEvent event); boolean registerSubTx(TxEvent subTxEvent, TxEventAddition subTxEventAddition); boolean checkIsExistsEventType(String globalTxId, String localTxId, String type);  }