|
|
@ -68,14 +68,12 @@ public class KafkaUtil {
|
|
|
|
|
|
|
|
|
|
|
|
properties.setProperty("enable.auto.commit", "true");
|
|
|
|
properties.setProperty("enable.auto.commit", "true");
|
|
|
|
properties.setProperty("auto.commit.interval.ms", "1000");
|
|
|
|
properties.setProperty("auto.commit.interval.ms", "1000");
|
|
|
|
properties.setProperty("session.timeout.ms", "30000");//一次session的连接超时时间
|
|
|
|
properties.setProperty("session.timeout.ms", "30000");
|
|
|
|
properties.setProperty("heartbeat.interval.ms", "30000");// 心跳时间,一般为超时时间的1/3,Consumer在被判定为死亡之前,能够发送至少 3 轮的心跳请求
|
|
|
|
properties.setProperty("auto.offset.reset", "earliest");
|
|
|
|
|
|
|
|
properties.setProperty("ssl.endpoint.identification.algorithm", "");
|
|
|
|
/*properties.setProperty("max.poll.interval.ms", "9000");//每隔多长时间去拉取消息。合理设置预期值,尽量但间隔时间消费者处理完业务逻辑,否则就会被coordinator判定为死亡,踢出Consumer Group,进行Rebalance
|
|
|
|
/*properties.setProperty("max.poll.interval.ms", "9000");//每隔多长时间去拉取消息。合理设置预期值,尽量但间隔时间消费者处理完业务逻辑,否则就会被coordinator判定为死亡,踢出Consumer Group,进行Rebalance
|
|
|
|
properties.setProperty("max.poll.records", "100");//一次从拉取出来的数据条数。根据消费业务处理耗费时长合理设置,如果每次max.poll.interval.ms 设置的时间较短,可以max.poll.records设置小点儿,少拉取些,这样不会超时。
|
|
|
|
properties.setProperty("max.poll.records", "100");//一次从拉取出来的数据条数。根据消费业务处理耗费时长合理设置,如果每次max.poll.interval.ms 设置的时间较短,可以max.poll.records设置小点儿,少拉取些,这样不会超时。
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
properties.setProperty("auto.offset.reset", "earliest");
|
|
|
|
|
|
|
|
properties.setProperty("ssl.endpoint.identification.algorithm", "");
|
|
|
|
|
|
|
|
return properties;
|
|
|
|
return properties;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|