problem: rskafka only fetches one record per topic

This commit is contained in:
Thilo Behnke
2022-07-10 14:59:56 +02:00
parent 8d3f9b540d
commit cf3d5db28e
3 changed files with 12 additions and 3 deletions

View File

@@ -150,7 +150,7 @@ impl KafkaEventReaderImpl {
async fn consume(&mut self) -> Result<Vec<EventWrapper>, String> {
debug!("kafka consumer called to consume messages for {:?} / {:?}", self.topic, self.partition);
// TODO: Only 1 message?
let next_res = tokio::time::timeout(Duration::from_millis(1), self.consumer.next()).await;
let next_res = tokio::time::timeout(Duration::from_millis(3), self.consumer.next()).await;
if let Err(e) = next_res {
info!("No record received in time after {}, timeout for {} / {}.", e, self.topic, self.partition);
return Ok(vec![]);