We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am setting the Kafka headers as follows in the publisher record
```
string app_name = AppInfo::app_info().app_name(); string host_name = IPAddress::our_host_name();
record->headers() = {{ kafka::Header{kafka::Header::Key{"Source"}, kafka::Header::Value{app_name.c_str(), app_name.size()}}, kafka::Header{kafka::Header::Key{"Host"}, kafka::Header::Value{host_name.c_str(), host_name.size()}} }};
When I try to print them in the consumer as follows as string they seem be clobbered
const string Headers() const { std::ostringstream outs; KAFKA_API::Headers headers = _consumer_record.headers(); std::for_each(headers.cbegin(), headers.cend(), [&outs](const auto& header) { outs << ((outs.str().length() == 0) ? "" : ",") << header.key << "=" << std::string((const char *)header.value.data(),header.value.size()); }); return outs.str(); }
Output of Headers ` Headers [Source=^@^@^@^@^@^@^@^@Ð^H^@ð^F^?^@^@her,Host=^@^@^@^@^@^@^@^@Ð^H^@ð^F^?^@^@group.com]` Any ideas what I am doing wrong ?
The text was updated successfully, but these errors were encountered:
Please disregard this issue - it is resolved now. The Header value ConstBuffer data pointer was not valid as local strings were used by sender
Sorry, something went wrong.
No branches or pull requests
I am setting the Kafka headers as follows in the publisher record
The text was updated successfully, but these errors were encountered: