I want to read, with Consume_Kafka_2_0, all the headers that come with the message, but without knowing their names first.
In NiFi ConsumeKafka:
- Headers to Add as Attributes (Regex): knowheader1|knownHeader|knownHeaderN --> no problem
- Headers to Add as Attributes (Regex): .* --> at some point "Exception when processing data from kafka so will close the lease org.apache.nifi.processors.kafka.pubsub.ConsumerPool$SimpleConsumerLease@xxxxxxx due to null: java.lang.NullPointerException
The above error seems due to the fact that some messages come with null headers, however I don't know how to save all the custom headers that come with the message and at the same time avoid the above error.