Skip to content

Commit

Permalink
Merge pull request #10 from takaomag/spike_deliver_msg_at_exit
Browse files Browse the repository at this point in the history
Add rd_kafka_poll() at exit. See issue #9 for detail.
  • Loading branch information
brg-liuwei authored Oct 31, 2016
2 parents 17676b1 + cab7427 commit 54531ba
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ngx_http_kafka_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,12 @@ void ngx_http_kafka_exit_worker(ngx_cycle_t *cycle)

main_conf = ngx_http_cycle_get_module_main_conf(cycle, ngx_http_kafka_module);

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);
}
Expand Down

0 comments on commit 54531ba

Please sign in to comment.