生產(chǎn)者發(fā)送消息的三種模式
1.發(fā)后即忘(常用)-------性能最高,可靠性最差
2.同步
3.異步
重試
Properties props = new Properties();
//配置kafka生產(chǎn)者重試次數(shù)
props.put(ProducerConfig.RETRIES_CONFIG, 3);
1.發(fā)后即忘(常用)-------性能最高,可靠性最差
2.同步
3.異步
Properties props = new Properties();
//配置kafka生產(chǎn)者重試次數(shù)
props.put(ProducerConfig.RETRIES_CONFIG, 3);