diff options
author | Christof Rabensteiner <christof.rabensteiner@iaik.tugraz.at> | 2020-02-18 12:19:01 +0100 |
---|---|---|
committer | Christof Rabensteiner <christof.rabensteiner@iaik.tugraz.at> | 2020-02-18 14:05:18 +0100 |
commit | 8400a1f99e7377e164a0d995359ff8c00a52c4e2 (patch) | |
tree | 59bb5ac8efee71c10b56b6f91672ba953b6242d2 /src/main/java/at/gv/egiz/moazs/backend/SaveResponseToFileSink.java | |
parent | c257eea0453dfb484cf4f7a68ccc04a472d08bb7 (diff) | |
download | moa-zs-8400a1f99e7377e164a0d995359ff8c00a52c4e2.tar.gz moa-zs-8400a1f99e7377e164a0d995359ff8c00a52c4e2.tar.bz2 moa-zs-8400a1f99e7377e164a0d995359ff8c00a52c4e2.zip |
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.
Diffstat (limited to 'src/main/java/at/gv/egiz/moazs/backend/SaveResponseToFileSink.java')
-rw-r--r-- | src/main/java/at/gv/egiz/moazs/backend/SaveResponseToFileSink.java | 2 |
1 files changed, 1 insertions, 1 deletions
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)); |