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

20th
Mar 2017
Neil Young
@nyoung
Mar 20 2017 16:37
heya folks - trying to use the php-rdkafka tool and it seems to be working well for our use case, except I can't figure out how to kill a publish or setup a publish timeout if there is some kind of connection error on all brokers
it just seems to sit and spin for a long time for me - is there some way to force it to fail from PHP?
Craig Patrick
@cpats007
Mar 20 2017 16:41
what is the issue you are having, so if the producer can’t produce, you want it to fail in PHP?
Neil Young
@nyoung
Mar 20 2017 16:42
yeah, i don't want the php request to sit and wait forever - i need it to drop the message on the floor and complete
Craig Patrick
@cpats007
Mar 20 2017 16:42
does this not work:
$topicConfig = new TopicConf();
$topicConfig->set('message.timeout.ms', 1000ms);
Neil Young
@nyoung
Mar 20 2017 16:43
trying it
thought i had been through all the settings - that one seems obvious
(derp)
Craig Patrick
@cpats007
Mar 20 2017 16:43
obviously you’ll need to change it for your code, bu then this:
/** @var ProducerTopic $kafkaTopic */
$kafkaTopic = $this->getProducer()->newTopic($topicName, $topicConfig);
Neil Young
@nyoung
Mar 20 2017 16:43
yeah
Craig Patrick
@cpats007
Mar 20 2017 16:44
:)
Neil Young
@nyoung
Mar 20 2017 16:44
i'm loading a topic config
Craig Patrick
@cpats007
Mar 20 2017 16:44
:thumbsup:
Neil Young
@nyoung
Mar 20 2017 16:51
Aw yeah, that worked - thanks @cpats007
Craig Patrick
@cpats007
Mar 20 2017 16:51
no problem