-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
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
Add rd_kafka_produceva() using a vtype array as an alternative to va-args #2902
Conversation
This looks like exactly what I was hoping for. Thanks. It's probably worth getting feedback from maintainers of librdkafka bindings in other languages. The bindings I'm working on are for Haskell, and I can confirm that this strategy works well for Haskell's foreign function interface and FFI-related tooling. |
} | ||
|
||
/* Partition the message */ | ||
err = rd_kafka_msg_partitioner(rkt, rkm, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
surprised to see this here, probably some unnecessary duplication of stuff, but not a big deal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The produceva() code is a direct copy of producev().
vus[2].u.header.val = "test value"; | ||
vus[2].u.header.size = -1; | ||
|
||
error = rd_kafka_produceva(rk, vus, 3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test coverage is a bit light on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fwiw, rd_kafka_produceva is compatible with .net p/invoke.
It is problematic to construct va-arg lists for calling C in some high-level languages that wrap librdkafka, erlang in the case of #2895.
This new method allows constructing an array of structs instead.