Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In the NetworkClient of new producer/consumer, currently we don't have a similar timeout for requests. The Adding a client side request timeout in NetworkClient would be useful for the following reasons:

1. For KafkaProducer.close() and KafkaProducer.flush() we need the request timeout as implict timeout.

2. Currently the producer sends requests in a non-blocking way and does not wait for response. If a socket is disconnected the network client will fail the requests with a NetworkException. However, It might take very long for TCP connection to timeout. And this mechanism is not sufficient in cases where a broker is hung.A client side request timeout in NetworkClient would be useful to solve this problem. The timeout will also be used as implicit timeout for some methods such as KafkaProducer.close(), KafkaProducer.flush()some cases. For example, if a broker is behind a VIP, it is possibel that the broker is down but the connection between client and VIP is still alive. In this case the client will never be able to receive the response. Adding a client side request timeout will help solve such kind of issues.

Public Interfaces

Add the following new configuration to org.apache.kafka.clients.producer.ProducerConfig and org.apache.kafka.clients.consumer.ConsumerConfig:

...