Skip to content
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

rd_kafka_poll before rd_kafka_destroy #9

Closed
takaomag opened this issue Oct 28, 2016 · 2 comments
Closed

rd_kafka_poll before rd_kafka_destroy #9

takaomag opened this issue Oct 28, 2016 · 2 comments

Comments

@takaomag
Copy link
Contributor

takaomag commented Oct 28, 2016

Hi,

Thank you so much for your cool module!

I have one suggestion about ngx_http_kafka_exit_worker.
https://github.com/brg-liuwei/ngx_kafka_module/blob/master/ngx_http_kafka_module.c#L386

In my opinion, rd_kafka_poll should be done until rd_kafka_outq_len(main_conf->rk) > 0, in order to ensure kafka messages to be delivered before exit.

rd_kafka_poll(main_conf->rk, 0);

while (rd_kafka_outq_len(main_conf->rk) > 0) {
    rd_kafka_poll(main_conf->rk, 100);
}

// TODO: rd_kafka_topic_destroy(each loc conf rkt );
rd_kafka_destroy(main_conf->rk);
@brg-liuwei
Copy link
Owner

Great!

Would you please commit a pull request?

@takaomag
Copy link
Contributor Author

Thanks and done the pull request.
#10

brg-liuwei added a commit that referenced this issue Oct 31, 2016
Add rd_kafka_poll() at exit. See issue #9 for detail.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants