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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to