diff --git a/internal/common/kafka/kafka.go b/internal/common/kafka/kafka.go index d5826281..87a6ea9c 100644 --- a/internal/common/kafka/kafka.go +++ b/internal/common/kafka/kafka.go @@ -149,7 +149,6 @@ func Produce(producer *kafka.Producer, topic string, value interface{}, key stri err = producer.Produce(msg, deliveryChan) if err != nil { - fmt.Printf("Produce failed: %v\n", err) return err } @@ -158,13 +157,9 @@ func Produce(producer *kafka.Producer, topic string, value interface{}, key stri m := e.(*kafka.Message) if m.TopicPartition.Error != nil { - fmt.Printf("Delivery failed: %v\n", m.TopicPartition.Error) return m.TopicPartition.Error } - fmt.Printf("Delivered message to topic %s [%d] at offset %v\n", - *m.TopicPartition.Topic, m.TopicPartition.Partition, m.TopicPartition.Offset) - return nil } diff --git a/internal/validator/handler.go b/internal/validator/handler.go index 4e306c11..8fee79ac 100644 --- a/internal/validator/handler.go +++ b/internal/validator/handler.go @@ -252,7 +252,7 @@ func (this *handler) produceMessage(ctx context.Context, topic string, value int if err := kafkaUtils.Produce(this.producer, topic, value, key, headers...); err != nil { instrumentation.ProducerError(ctx, err, topic) - if ignoreKafkaError(err) { + if ignoreKafkaProduceError(err) { return } @@ -261,7 +261,7 @@ func (this *handler) produceMessage(ctx context.Context, topic string, value int } } -func ignoreKafkaError(err error) bool { +func ignoreKafkaProduceError(err error) bool { kafkaErr := err.(kafka.Error)