diff options
author | Christof Rabensteiner <christof.rabensteiner@iaik.tugraz.at> | 2019-12-02 14:26:42 +0100 |
---|---|---|
committer | Christof Rabensteiner <christof.rabensteiner@iaik.tugraz.at> | 2019-12-03 09:08:44 +0100 |
commit | 8799a27e8d73c5e079d549f6d76abf861d75ee9e (patch) | |
tree | 5c8d5201be097654155d9ad69f3af12ebd8d749a /src/main/java/at/gv/egiz/moazs/service | |
parent | 6dbe979e0b6bd6236db304b034ad592a4aeacabc (diff) | |
download | moa-zs-8799a27e8d73c5e079d549f6d76abf861d75ee9e.tar.gz moa-zs-8799a27e8d73c5e079d549f6d76abf861d75ee9e.tar.bz2 moa-zs-8799a27e8d73c5e079d549f6d76abf861d75ee9e.zip |
Finalize "Removal of JAXB Class Not Found Fix"
- Problem: I fixed CompletableFuture.*async within the DeliveryRequest
flow, but forgot to do the same for the DeliveryRequestStatus /
DeliveryNotification flow.
- Solution: Ensure that all CompletableFuture.*async() invocations
have Spring's task executor attached.
Diffstat (limited to 'src/main/java/at/gv/egiz/moazs/service')
-rw-r--r-- | src/main/java/at/gv/egiz/moazs/service/MsgService.java | 11 | ||||
-rw-r--r-- | src/main/java/at/gv/egiz/moazs/service/MzsService.java | 2 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/main/java/at/gv/egiz/moazs/service/MsgService.java b/src/main/java/at/gv/egiz/moazs/service/MsgService.java index 8c71166..6b260e7 100644 --- a/src/main/java/at/gv/egiz/moazs/service/MsgService.java +++ b/src/main/java/at/gv/egiz/moazs/service/MsgService.java @@ -28,6 +28,7 @@ import at.gv.egiz.moazs.scheme.RequestStatusResponse; import at.gv.zustellung.msg.xsd.*; import org.apache.cxf.annotations.SchemaValidation; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.task.TaskExecutor; import org.springframework.stereotype.Service; import java.util.function.Consumer; @@ -43,16 +44,18 @@ import static java.util.concurrent.CompletableFuture.runAsync; */ @Service @SchemaValidation(type = SchemaValidation.SchemaValidationType.BOTH) -@org.apache.cxf.feature.Features (features = "org.apache.cxf.ext.logging.LoggingFeature") + @org.apache.cxf.feature.Features (features = "org.apache.cxf.ext.logging.LoggingFeature") public class MsgService implements Zuse2AppPort { private final DeliveryRepository repository; private final Consumer<String> backend; + private final TaskExecutor taskExecutor; @Autowired - public MsgService(DeliveryRepository repository, Consumer<String> msgResponseBackend) { + public MsgService(DeliveryRepository repository, Consumer<String> msgResponseBackend, TaskExecutor taskExecutor) { this.repository = repository; this.backend = msgResponseBackend; + this.taskExecutor = taskExecutor; } @Override @@ -85,8 +88,8 @@ public class MsgService implements Zuse2AppPort { } private void sendToWork(MsgResponse response) { - runAsync(() -> repository.store(response)) - .thenRunAsync(() -> backend.accept(response.getResponseID())); + runAsync(() -> repository.store(response), taskExecutor) + .thenRunAsync(() -> backend.accept(response.getResponseID()), taskExecutor); } private DeliveryNotificationACKType notificationAck(String appDeliveryID, String zsDeliveryID) { 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 55f0554..ee14af8 100644 --- a/src/main/java/at/gv/egiz/moazs/service/MzsService.java +++ b/src/main/java/at/gv/egiz/moazs/service/MzsService.java @@ -142,7 +142,7 @@ public class MzsService implements App2MzsPortType { log.info(SERVICE_TIME_OUT_REACHED_MSG, appDeliveryID); var sinkParams = request.getConfig().getMsgResponseSinks(); - requestProcessed.thenAcceptAsync(response -> hub.applySinks(response, sinkParams)); + requestProcessed.thenAcceptAsync(response -> hub.applySinks(response, sinkParams), taskExecutor); return generatePartialSuccessResponse(appDeliveryID); } |