Github user dtrodrigues commented on a diff in the pull request:

    https://github.com/apache/nifi-minifi-cpp/pull/360#discussion_r198360594
  
    --- Diff: extensions/librdkafka/PublishKafka.h ---
    @@ -115,14 +121,35 @@ class PublishKafka: public core::Processor {
           buffer.reserve(max_seg_size_);
           read_size_ = 0;
           status_ = 0;
    +      rd_kafka_resp_err_t err;
    +
    +      for (auto kv : flowFile_->getAttributes()) {
    +        if (regex_match(kv.first, attributeNameRegex_)) {
    +          if (!hdrs) {
    +            hdrs = rd_kafka_headers_new(8);
    --- End diff --
    
    8 was mostly arbitrary, I used the value from 
https://github.com/edenhill/librdkafka/blob/master/examples/rdkafka_example.c#L416
 since some value needed to be used. 0 is also an option but it looks like if 0 
is chosen, any additions will grow the list to 16 elements. If a number besides 
0 is chosen, when list runs out of room, the list is grown by 2*the list size.


---

Reply via email to