79742536

Date: 2025-08-21 16:03:24
Score: 1
Natty:
Report link

https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletionStage.html#whenComplete-java.util.function.BiConsumer-

If the supplied action itself encounters an exception, then the returned stage exceptionally completes with this exception unless this stage also completed exceptionally.

And you unconditionally throw an exception there in whenComplete(), regardless of an actual result (I genuinely can't comprehend why).

Maybe, just maybe, try to process the result, at least?
It's a SendResult object, so you got a bit more clue of what's poppin', as well as let a Spring Kafka Container container complete its job.

Reasons:
  • No code block (0.5):
  • Contains question mark (0.5):
Posted by: Yuri G