You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2023-02-21 21:31:32,456 WARN [io.ver.cor.imp.BlockedThreadChecker] (vertx-blocked-thread-checker) Thread Thread[vert.x-eventloop-thread-2,5,main] has been blocked for 345343 ms, time limit is 2000 ms: io.vertx.core.VertxException: Thread blocked
at java.base@11.0.18/jdk.internal.misc.Unsafe.park(Native Method)
at java.base@11.0.18/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194)
at java.base@11.0.18/java.util.concurrent.CompletableFuture$Signaller.block(CompletableFuture.java:1796)
at java.base@11.0.18/java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3128)
at java.base@11.0.18/java.util.concurrent.CompletableFuture.waitingGet(CompletableFuture.java:1823)
at java.base@11.0.18/java.util.concurrent.CompletableFuture.join(CompletableFuture.java:2043)
at io.smallrye.context.CompletableFutureWrapper.join(CompletableFutureWrapper.java:166)
at org.acme.Processor.process(Processor.java:30)
...
I had to refactor it to something like
@Incoming("ticks")
@Outgoing("processed")
@Acknowledgment(Acknowledgment.Strategy.MANUAL)
CompletionStage<Message<String>> process(Message<Long> message) throwsException {
if (count++ % 8 == 0) {
message.nack(newThrowable("Random failure to process a record.")).toCompletableFuture().join();
returnnull;
}
returnmessage.ack().thenApply(s -> {
Stringvalue = String.valueOf(message.getPayload());
try {
value += " consumed in pod (" + InetAddress.getLocalHost().getHostName() + ")";
} catch (UnknownHostExceptione) {
thrownewRuntimeException(e);
}
returnmessage.withPayload(value);
});
}
to make it non-blocking and get the intended behavior described in the book (page 255).
The text was updated successfully, but these errors were encountered:
At
reactive-systems-in-java/chapter-13/processor-health/src/main/java/org/acme/Processor.java
Line 28 in f9d339e
I had to refactor it to something like
to make it non-blocking and get the intended behavior described in the book (page 255).
The text was updated successfully, but these errors were encountered: