From 536389b81ed8a40d794ee8e77a620a8a2930f3c6 Mon Sep 17 00:00:00 2001 From: Artem Sidorkin Date: Tue, 27 Jul 2021 19:28:21 +0300 Subject: [PATCH] Simplified ReactiveSagaInstanceRepositoryJdbc.find --- .../orchestration/ReactiveSagaInstanceRepositoryJdbc.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/eventuate-tram-sagas-reactive-orchestration/src/main/java/io/eventuate/tram/sagas/reactive/orchestration/ReactiveSagaInstanceRepositoryJdbc.java b/eventuate-tram-sagas-reactive-orchestration/src/main/java/io/eventuate/tram/sagas/reactive/orchestration/ReactiveSagaInstanceRepositoryJdbc.java index dc6033b..1b3092a 100644 --- a/eventuate-tram-sagas-reactive-orchestration/src/main/java/io/eventuate/tram/sagas/reactive/orchestration/ReactiveSagaInstanceRepositoryJdbc.java +++ b/eventuate-tram-sagas-reactive-orchestration/src/main/java/io/eventuate/tram/sagas/reactive/orchestration/ReactiveSagaInstanceRepositoryJdbc.java @@ -87,15 +87,13 @@ public Mono find(String sagaType, String sagaId) { (row, rowMetadata) -> new DestinationAndResource(row.get("destination").toString(), row.get("resource").toString()), sagaType, sagaId); - Mono> result = destinationAndResources.collectList().flatMap(dar -> + return destinationAndResources.collectList().flatMap(dar -> eventuateJdbcStatementExecutor.queryForList(sagaInstanceRepositorySql.getSelectFromSagaInstanceSql(), (row, rowMetadata) -> new SagaInstance(sagaType, sagaId, row.get("state_name").toString(), row.get("last_request_id").toString(), new SerializedSagaData(row.get("saga_data_type").toString(), row.get("saga_data_json").toString()), new HashSet<>(dar)), - sagaType, sagaId).collectList()); - - return result.flatMapMany(Flux::fromIterable).single(); + sagaType, sagaId).single()); }