Skip to content

Commit

Permalink
ACTIONITEM-3738: Improve the log message for the "There are no nodes …
Browse files Browse the repository at this point in the history
…in the Kafka cluster" error. (#523)

* ACTIONITEM-3738: Improve the log message for the "There are no nodes in the Kafka cluster" error.

* Improve error msg.

* More improvements.

---------

Co-authored-by: [email protected] <[email protected]>
  • Loading branch information
Yellow-Rice and [email protected] authored Dec 10, 2024
1 parent 1ae59d4 commit f69849c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,8 @@ public void close() {
public Node leastLoadedNode(long now) {
List<Node> nodes = this.metadataUpdater.fetchNodes();
if (nodes.isEmpty())
throw new IllegalStateException("There are no nodes in the Kafka cluster");
throw new IllegalStateException("metadataUpdater returned empty node list. "
+ "The client is not able to connect to the Kafka cluster or there are no nodes in the Kafka cluster.");
LeastLoadedNodeAlgorithm algo = this.leastLoadedNodeAlgorithm;
if (algo == null) {
throw new IllegalStateException("leastLoadedNodeAlgorithm cannot be null");
Expand Down

0 comments on commit f69849c

Please sign in to comment.