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

Why is zookeeper.connection.timeout.ms set?

srdo opened this issue · comments

Hi,

EmbeddedKafka sets the zookeeper.connection.timeout.ms to 10 seconds. I was wondering what the point is of setting this config explicitly? According to the Kafka documentation, the connection timeout will follow the zookeeper.session.timeout.ms (default 18s) if you don't specify the connection timeout. It seems a little weird to only want to wait 10 seconds for a connection, but to be willing to wait 18 seconds between heartbeats before timing out the ZK session.

Would it make sense to not set zookeeper.connection.timeout.ms in EmbeddedKafka by default? That way, the two properties will have the same value by default.

Hi @srdo, I did some research and found out when those values were added: it was back in 2016 on this PR.
I don't think there was a specific reason behind the value and I agree with you that it would make perfect sense not to set any value in the library.

@NeQuissimus what do you think?