I
have designed a worfklow which uses a Event Gateway after the intermediate message
Here is the flow,
-> A throwing intermediate message which publish the message to the kafka topic (---it is working as expected) -> Then followed by the Event Gateway which wait for the message from the kafka topic
-> A catching intermediate message which consume the message to the kafka topic
DEbugging further,I get to see this below error,
2022-05-12 18:51:55,411 INFO [io.sma.rea.mes.kafka] (vert.x-eventloop-thread-0) SRMSG18256: Initialize record store for topic-partition 'incomingmessage-0' at position 23.
2022-05-12 18:51:55,495 DEBUG [org.kie.kog.ser.eve.imp.DefaultEventUnmarshaller] (pool-1-thread-1) Converting event with payload { "customerName":"Bob","customerAge": 20,"customerAddress": "123123", "customerProvince": "ON","isAdultOrMinor": "yes", "approved":true} to class class ca.bell.customer.bell.Customer
2022-05-12 18:51:55,499 DEBUG [org.kie.kog.ser.eve.imp.DefaultEventUnmarshaller] (pool-1-thread-1) Converting event with payload { "customerName":"Bob","customerAge": 20,"customerAddress": "123123", "customerProvince": "ON","isAdultOrMinor": "yes", "approved":true} to class class ca.bell.customer.bell.Customer
2022-05-12 18:51:55,501 ERROR [org.kie.kog.add.qua.mes.com.AbstractQuarkusCloudEventReceiver] (pool-1-thread-1) Error processing message { "customerName":"Bob","customerAge": 20,"customerAddress": "123123", "customerProvince": "ON","isAdultOrMinor": "yes", "approved":true}: java.util.concurrent.CompletionException: java.util.NoSuchElementException: No value present
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314)
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1739)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.util.NoSuchElementException: No value present
at java.base/java.util.Optional.get(Optional.java:148)
at org.kie.kogito.event.impl.DataEventConsumer.lambda$consume$0(DataEventConsumer.java:47)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1736)
... 3 more
Please find the attached project for your reference.