embeddedkafka / embedded-kafka

A library that provides an in-memory Kafka instance to run your tests against.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ZooKeeperClientTimeoutException when starting the server

csnikitin opened this issue · comments

I am using version 2.4.1.1.

Every once in a while, when calling EmbeddedKafka.start() during unit tests, I receive the following error kafka.zookeeper.ZooKeeperClientTimeoutException: Timed out waiting for connection while in state: CONNECTING.

Ah, it looks like the timeout can be manually specified. For example:

EmbeddedKafkaConfig( kafkaPort = 9092, zooKeeperPort = 2182, customBrokerProperties = Map("zookeeper.connection.timeout.ms" -> "30000"))

This seems to have resolved the issue.