From 8400a1f99e7377e164a0d995359ff8c00a52c4e2 Mon Sep 17 00:00:00 2001 From: Christof Rabensteiner Date: Tue, 18 Feb 2020 12:19:01 +0100 Subject: Timeout & Assync Fixes - Fix: Parser Error that occurs when MOA ZS goes into service timeout. - Fix: Improve exception handling on MOA ZS Async. - Before: When MOA ZS processes delivery request but hits a timeout, MOA ZS would answer syncronously to the Sender app and forward the result assynchronously at a later point. If an exception were to occur after the timeout, MOA ZS would swallow this exception. - Now: If an exception occurs, MOA ZS converts the exception into a response and hands it over to the sink hub for proper processing of the event. --- src/main/java/at/gv/egiz/moazs/backend/SaveResponseToFileSink.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/at/gv/egiz/moazs/backend/SaveResponseToFileSink.java') diff --git a/src/main/java/at/gv/egiz/moazs/backend/SaveResponseToFileSink.java b/src/main/java/at/gv/egiz/moazs/backend/SaveResponseToFileSink.java index c844511..d442add 100644 --- a/src/main/java/at/gv/egiz/moazs/backend/SaveResponseToFileSink.java +++ b/src/main/java/at/gv/egiz/moazs/backend/SaveResponseToFileSink.java @@ -86,7 +86,7 @@ public class SaveResponseToFileSink { .exceptionally(ex -> logException(ex, responseID)); var binaryResponsePath = generatePath(rootPath, responseID, "binary.xml"); - var storeBinaryResponseToFileSystemFuture = supplyAsync(() -> repository.retrieveBinaryResponse(responseID).get(), taskExecutor) + var storeBinaryResponseToFileSystemFuture = supplyAsync(() -> repository.retrieveBinaryResponse(responseID).orElse(new byte[0]), taskExecutor) .thenAccept(binaryResponseByteArray -> storeToFile(binaryResponsePath, binaryResponseByteArray)) .exceptionally(ex -> logException(ex, responseID)); -- cgit v1.2.3