You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/04/06 06:25:27 UTC

[GitHub] [druid] himanshug commented on a change in pull request #9573: Fix some flaws of KafkaEmitter

himanshug commented on a change in pull request #9573: Fix some flaws of KafkaEmitter
URL: https://github.com/apache/druid/pull/9573#discussion_r403854106
 
 

 ##########
 File path: extensions-contrib/kafka-emitter/src/main/java/org/apache/druid/emitter/kafka/KafkaEmitter.java
 ##########
 @@ -130,21 +120,21 @@ public void start()
 
   private void sendMetricToKafka()
   {
-    sendToKafka(config.getMetricTopic(), metricQueue);
+    sendToKafka(config.getMetricTopic(), metricQueue, setProducerCallback(metricLost));
   }
 
   private void sendAlertToKafka()
   {
-    sendToKafka(config.getAlertTopic(), alertQueue);
+    sendToKafka(config.getAlertTopic(), alertQueue, setProducerCallback(alertLost));
   }
 
-  private void sendToKafka(final String topic, MemoryBoundLinkedBlockingQueue<String> recordQueue)
+  private void sendToKafka(final String topic, MemoryBoundLinkedBlockingQueue<String> recordQueue, Callback callback)
   {
     ObjectContainer<String> objectToSend;
     try {
       while (true) {
         objectToSend = recordQueue.take();
-        producer.send(new ProducerRecord<>(topic, objectToSend.getData()), producerCallback);
+        producer.send(new ProducerRecord<>(topic, objectToSend.getData()), callback);
       }
     }
     catch (InterruptedException e) {
 
 Review comment:
   ```suggestion
       catch (Throwable e) {
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org