opentracing-contrib / java-kafka-client

OpenTracing Instrumentation for Apache Kafka Client
Apache License 2.0
125 stars 64 forks source link

NullPointerException when an header has no value (null) #41

Closed ghilainm closed 5 years ago

ghilainm commented 5 years ago

I have a NullPointerException when I send an header with a null value.

java.lang.NullPointerException: null
    at java.lang.String.<init>(java.base@10.0.2-adoptopenjdk/String.java:3615)
    at io.opentracing.contrib.kafka.HeadersMapExtractAdapter.<init>(HeadersMapExtractAdapter.java:38)
    at io.opentracing.contrib.kafka.TracingKafkaUtils.extract(TracingKafkaUtils.java:42)
    at io.opentracing.contrib.kafka.TracingKafkaUtils.buildAndFinishChildSpan(TracingKafkaUtils.java:115)
    at io.opentracing.contrib.kafka.TracingKafkaUtils.buildAndFinishChildSpan(TracingKafkaUtils.java:110)
    at io.opentracing.contrib.kafka.TracingConsumerInterceptor.onConsume(TracingConsumerInterceptor.java:29)
    at org.apache.kafka.clients.consumer.internals.ConsumerInterceptors.onConsume(ConsumerInterceptors.java:61)
    at org.apache.kafka.clients.consumer.KafkaConsumer.poll(KafkaConsumer.java:1200)
    at org.apache.kafka.clients.consumer.KafkaConsumer.poll(KafkaConsumer.java:1115)
    at 
malafeev commented 5 years ago

fixed via https://github.com/opentracing-contrib/java-kafka-client/pull/42