当我试图从DB2数据库中读取大量数据,并写入Kafka主题时,获取此错误-?继续强制关闭生产者,因为挂起的请求无法在超时30000毫秒内完成。如何增加超时时间?
发布于 2020-10-16 21:57:40
此消息来自close()操作。
Spring通常不会关闭生产者,直到应用程序上下文关闭。
您可以在DefaultKafkaProducerFactory上增加此超时。
/**
* The time to wait when physically closing the producer via the factory rather than
* closing the producer itself (when {@link #reset()}, {@link #destroy()
* #closeProducerFor(String)}, or {@link #closeThreadBoundProducer()} are invoked).
* Specified in seconds; default {@link #DEFAULT_PHYSICAL_CLOSE_TIMEOUT}.
* @param physicalCloseTimeout the timeout in seconds.
* @since 1.0.7
*/
public void setPhysicalCloseTimeout(int physicalCloseTimeout) {
this.physicalCloseTimeout = Duration.ofSeconds(physicalCloseTimeout);
}https://stackoverflow.com/questions/64389445
复制相似问题