From 4dfd9c1df627b808e46bbcf93dd6477fcf2cde0f Mon Sep 17 00:00:00 2001 From: Soby Chacko Date: Thu, 24 Oct 2024 15:02:50 -0400 Subject: [PATCH] GH-3024: Add logging for exceptions in KafkaTopicProvisioner Related to https://github.com/spring-cloud/spring-cloud-stream/issues/3024 --- .../binder/kafka/provisioning/KafkaTopicProvisioner.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/provisioning/KafkaTopicProvisioner.java b/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/provisioning/KafkaTopicProvisioner.java index 634651546..a6830df4e 100644 --- a/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/provisioning/KafkaTopicProvisioner.java +++ b/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/provisioning/KafkaTopicProvisioner.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2023 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -668,6 +668,7 @@ public class KafkaTopicProvisioner implements partitions = callable.call(); } catch (Exception ex) { + logger.warn("Error occurred while calculating partitions for topic: " + topicName, ex); // The above call can potentially throw exceptions such as timeout. If // we can determine // that the exception was due to an unknown topic on the broker, just