These are chat archives for arnaud-lb/php-rdkafka

25th
Apr 2016
Arnaud Le Blanc
@arnaud-lb
Apr 25 2016 07:56
Hi @Tapus
It seems that this issue has been fixed by arnaud-lb/php-rdkafka#47, could you confirm?
Tapus
@Tapus
Apr 25 2016 10:22
Hey @arnaud-lb ! Yes, my coworker submitted my fix, I can confirm. I have some other questions though :D
  • How should I proceed to exit the rdkafka threads when a critical error appears ? I would like to be able to stop my process in that case.
  • Is there any way to ensure that the messages produced have been received by the broker ? There doesn't seem to be any message delivery callback, so I cannot know which message has been and not been delivered.
    Thanks !
Arnaud Le Blanc
@arnaud-lb
Apr 25 2016 11:26
Great! Did you tried exit()'ing in the error callback ?
Arnaud Le Blanc
@arnaud-lb
Apr 25 2016 11:32

Is there any way to ensure that the messages produced have been received by the broker ?

By default, librdkafka won’t give up trying to send a message until it’s actually sent. So, doing nothing special will ensure that the message is eventually sent.

If you need to know exactly when it has been successfuly sent, you need delivery report callbacks, as described at https://github.com/edenhill/librdkafka/wiki/Sync-producer

Note that delivery report callbacks are yet to be implemented in php-rdkafka

Tapus
@Tapus
Apr 25 2016 12:00

Great! Did you tried exit()'ing in the error callback ?

I did, but it ends up segfaulting most of the time, seems like this is due to the internal librdkafka thread termination. A SIGTERM seems to do the trick, though.

If you need to know exactly [...] php-rdkafka

Yep, so I guess i need a dr_cb, because the way my script needs to work is to parse some files, produce several messages, and then do a specific task depending on the report callback.
Would you be interested if I pull-request the dr_cb feature ? I guess this should follow the same principle than error_cb and rebalance_cb, right ?

Arnaud Le Blanc
@arnaud-lb
Apr 25 2016 12:04
Indeed, I would be interested by such a pull-request :)
Tapus
@Tapus
Apr 25 2016 15:39
@arnaud-lb Here you go, give us your thoughts about arnaud-lb/php-rdkafka#49
Arnaud Le Blanc
@arnaud-lb
Apr 25 2016 15:47
Awesome! I’ll take a look soon today :)
Arnaud Le Blanc
@arnaud-lb
Apr 25 2016 16:19
Merged, thanks!