在将数据生成到UAT环境时出现此错误:
org.apache.kafka.common.errors.TimeoutException: Expiring 1 record(s) for topic-2: 30808 ms has passed since batch creation plus linger time
在开发环境中,它运行良好,在UAT kafka日志中推送了数据,但是却花费了很多时间。
public ProducerFactory<String, Object> producerFactory() {
Map<String, Object> config = new HashMap<>();
config.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG,"ip:port");
config.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG,
StringSerializer.class);
config.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG,
StringSerializer.class);}