why is the first member of the tuple received from kafka using spark direct stream is null -


when reading messages kafka using kafkautils.createdirectstream, v1._1 member of tuple2 null:

kafkautils.createdirectstream(                 streamingcontext,                 string.class,                 string.class,                 stringdecoder.class,                 stringdecoder.class,                 kafkaparams,                 topicsset                 ).map(new function<tuple2<string,string>, string>() {                     @override                     public string call(tuple2<string, string> v1)                             throws exception {                         system.out.println(v1._1);                         return null;                     }                 }); 

while _2 member contains message passed kafka.

i have 2 questions:

1) why v1._1 null?

2) there way pass topic name in kafka (the same way message put kafka) v1._1 contain topic name?


Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -