Add support for rd_kafka_destroy_flags.#247
Conversation
accelerated
left a comment
There was a problem hiding this comment.
Just my 2 cents on this PR. Good idea to port this API!
|
BTW: it didn't help with the original problem :\ Still need draining after unsubscribe: confluentinc/librdkafka#2898 |
|
Why do you need to connect 2 consumers inside the same app to the same topic? |
|
3 reasons:
|
|
I would recommend not having multiple consumers in the same app if you can. It's very counterintuitive and you may run into other issues down the line. |
I can't :) |
|
@filimonov Also, since |
|
I've tried, but it seem like it will require deeper look to do that If you can improve that - please do. |
|
Yeah I just see there's a requirement for the deleter to be default constructible so yes, you can't use any references unfortunately. Will let @mfontanini review. Looks good to me. |
|
Thanks for the PR! |
That allows to set flags for rd_kafka_destroy_flags in the following manner:
It allows us to prevents potential hang during termination if consumer.close() is failing because of queued callback calls.
Refs:
More:
cppkafka/tests/consumer_test.cpp
Lines 245 to 260 in 006642c
Many thanks to @azat for help.