Skip to content

Commit

Permalink
When transaction ingestion failed return a failure response so the tr…
Browse files Browse the repository at this point in the history
…ansaction composition consumer can handle it accordingly.
  • Loading branch information
shafiquech committed Sep 8, 2023
1 parent fb247e8 commit 533eaf8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public Mono<ProductIngestResponse> handleSuccess(ProductIngestResponse res) {
.doOnNext(r -> log.info("Product ingestion completed successfully for SA {}",
res.getServiceAgreementInternalId()))
.flatMap(this::processTransactionChains)
.onErrorResume(x -> Mono.just(res))
.flatMap(this::processPaymentOrderChains)
.doOnNext(this::processSuccessEvent)
.doOnNext(r -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ public Mono<List<TransactionsPostResponseBody>> handleFailure(Throwable error) {
envelopedEvent.setEvent(event);
eventBus.emitEvent(envelopedEvent);
}
return Mono.empty();
return Mono.error(error);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ void ingestionInPullMode_Failure() {
Mono<TransactionIngestResponse> productIngestResponse = transactionIngestionService
.ingestPull(mockTransactionIngestPullRequest());
StepVerifier.create(productIngestResponse)
.verifyComplete();
.verifyError();
}

@Test
Expand Down

0 comments on commit 533eaf8

Please sign in to comment.