Closed jonathan-dev closed 1 year ago
Hi, @jonathan-dev
The value
type of header
is const_buffer
, and the lifetime depends on the ConsumerRecord
.
So, either you keep the record
until it has been processed, or deep-copy the memory block for header.value()
before releasing the record
.
Ok. make sense. Thanks for the answer. I'll close this.
I am receiving kafka messages like it is done in this example and from there I am passing the record.headers() through my application. But it seems that is the memory that it points to is invalidated after some point... how can I ensure that the memory stays alive? or what is the suggested way of dealing with this.
thanks