You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/03/12 12:05:59 UTC

[GitHub] vvraskin commented on a change in pull request #3423: Measure kafka queue in consumer with better exactitude

vvraskin commented on a change in pull request #3423: Measure kafka queue in consumer with better exactitude
URL: https://github.com/apache/incubator-openwhisk/pull/3423#discussion_r173773643
 
 

 ##########
 File path: common/scala/src/main/scala/whisk/connector/kafka/KafkaConsumerConnector.scala
 ##########
 @@ -62,7 +67,11 @@ class KafkaConsumerConnector(
     val wakeUpTask = actorSystem.scheduler.scheduleOnce(cfg.sessionTimeoutMs.milliseconds + 1.second)(consumer.wakeup())
 
     try {
-      consumer.poll(duration.toMillis).map(r => (r.topic, r.partition, r.offset, r.value))
+      val response = consumer.poll(duration.toMillis).map(r => (r.topic, r.partition, r.offset, r.value))
+      response.lastOption.foreach {
+        case (_, _, newOffset, _) => offset = newOffset + 1
 
 Review comment:
   Do you mean updating the offset each time new message arrives?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services