aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/gv/egiz/moazs/service/MzsService.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/main/java/at/gv/egiz/moazs/service/MzsService.java b/src/main/java/at/gv/egiz/moazs/service/MzsService.java
index d48f668..77027a9 100644
--- a/src/main/java/at/gv/egiz/moazs/service/MzsService.java
+++ b/src/main/java/at/gv/egiz/moazs/service/MzsService.java
@@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.jws.WebParam;
+import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.function.Consumer;
@@ -78,10 +79,7 @@ public class MzsService implements App2MzsPortType {
return converter.convert(status, binaryStatus);
} catch (TimeoutException e) {
- logger.info(format(SERVICE_TIME_OUT_REACHED_MSG, appDeliveryID), e);
- var sinkParams = completeRequest.getConfig().getMsgResponseSinks();
- requestProcessed.thenAcceptAsync(response -> hub.applySinks(response, sinkParams));
- return generatePartialSuccessResponse(appDeliveryID);
+ return handleAssyncStatus(appDeliveryID, completeRequest, requestProcessed);
} catch (Exception e) {
var message = format(MZS_SERVICE_ERROR_MSG, appDeliveryID);
@@ -90,6 +88,16 @@ public class MzsService implements App2MzsPortType {
}
+ private DeliveryResponseType handleAssyncStatus(String appDeliveryID, DeliveryRequestType request,
+ CompletableFuture<RequestStatusResponse> requestProcessed) {
+
+ logger.info(format(SERVICE_TIME_OUT_REACHED_MSG, appDeliveryID));
+ var sinkParams = request.getConfig().getMsgResponseSinks();
+ requestProcessed.thenAcceptAsync(response -> hub.applySinks(response, sinkParams));
+
+ return generatePartialSuccessResponse(appDeliveryID);
+ }
+
private RequestStatusResponse process(DeliveryRequestType deliveryRequest) {
var appDeliveryID = deliveryRequest.getMetaData().getAppDeliveryID();