From aebb2d824a2272e713edd6c1c86249d99446bc2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pere=20Fern=C3=A1ndez?= Date: Fri, 20 Dec 2024 15:05:41 +0100 Subject: [PATCH] Revert [incubator-kie-issues#1633] Removing blocking completablefuture.get invocation (#2148 (#2168) --- .../org/kie/kogito/jobs/embedded/JobInVMEventPublisher.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jobs-service/kogito-addons-jobs-service/kogito-addons-quarkus-jobs/src/main/java/org/kie/kogito/jobs/embedded/JobInVMEventPublisher.java b/jobs-service/kogito-addons-jobs-service/kogito-addons-quarkus-jobs/src/main/java/org/kie/kogito/jobs/embedded/JobInVMEventPublisher.java index ba7b0e1ef8..78434dc841 100644 --- a/jobs-service/kogito-addons-jobs-service/kogito-addons-quarkus-jobs/src/main/java/org/kie/kogito/jobs/embedded/JobInVMEventPublisher.java +++ b/jobs-service/kogito-addons-jobs-service/kogito-addons-quarkus-jobs/src/main/java/org/kie/kogito/jobs/embedded/JobInVMEventPublisher.java @@ -20,6 +20,7 @@ package org.kie.kogito.jobs.embedded; import java.util.List; +import java.util.concurrent.ExecutionException; import org.eclipse.microprofile.config.inject.ConfigProperty; import org.kie.kogito.event.EventPublisher; @@ -80,9 +81,9 @@ public JobDetails publishJobStatusChange(JobDetails jobDetails) { return jobDetails; } - bus.fireAsync(new EmbeddedJobServiceEvent(jobDetails)); + bus.fireAsync(new EmbeddedJobServiceEvent(jobDetails)).toCompletableFuture().get(); return jobDetails; - } catch (Exception e) { + } catch (InterruptedException | ExecutionException e) { throw new RuntimeException(e); } }