Log Kafka sending error which caused channel cancel (#2447)

Signed-off-by: Daniel Kec <daniel.kec@oracle.com>
This commit is contained in:
Daniel Kec
2020-10-15 11:46:25 +02:00
committed by GitHub
parent 69d0ae25c6
commit 1cb9fbd6b9

View File

@@ -96,6 +96,7 @@ public class KafkaSubscriber<K, V> implements Subscriber<Message<V>> {
kafkaProducer.send(record, (metadata, exception) -> {
if (exception != null) {
subscription.cancel();
LOGGER.log(Level.WARNING, "Error when sending kafka message to topic: " + topic, exception);
completableFuture.completeExceptionally(exception);
} else {
completableFuture.complete(null);