This repository was archived by the owner on Jul 17, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313$ conf ->set ('metadata.broker.list ' , $ broker );
1414$ conf ->set ('enable.auto.commit ' , 'false ' );
1515$ conf ->set ('offset.store.method ' , 'broker ' );
16+ $ conf ->set ('socket.blocking.max.ms ' , 50 );
1617$ conf ->setDefaultTopicConf ($ topicConf );
1718
1819$ consumer = new \RdKafka \KafkaConsumer ($ conf );
1920
2021// create producer
21- $ producer = new \RdKafka \Producer ();
22+ $ conf = new \RdKafka \Conf ();
23+ $ conf ->set ('socket.blocking.max.ms ' , 50 );
24+ $ conf ->set ('queue.buffering.max.ms ' , 20 );
25+
26+ $ producer = new \RdKafka \Producer ($ conf );
2227$ producer ->addBrokers ($ broker );
2328
2429$ adapter = new \Superbalist \PubSub \Kafka \KafkaPubSubAdapter ($ producer , $ consumer );
Original file line number Diff line number Diff line change 1313$ conf ->set ('metadata.broker.list ' , $ broker );
1414$ conf ->set ('enable.auto.commit ' , 'false ' );
1515$ conf ->set ('offset.store.method ' , 'broker ' );
16+ $ conf ->set ('socket.blocking.max.ms ' , 50 );
1617$ conf ->setDefaultTopicConf ($ topicConf );
1718
1819$ consumer = new \RdKafka \KafkaConsumer ($ conf );
1920
2021// create producer
21- $ producer = new \RdKafka \Producer ();
22+ $ conf = new \RdKafka \Conf ();
23+ $ conf ->set ('socket.blocking.max.ms ' , 50 );
24+ $ conf ->set ('queue.buffering.max.ms ' , 20 );
25+
26+ $ producer = new \RdKafka \Producer ($ conf );
2227$ producer ->addBrokers ($ broker );
2328
2429$ adapter = new \Superbalist \PubSub \Kafka \KafkaPubSubAdapter ($ producer , $ consumer );
2530
26- $ adapter ->publish ('my_channel ' , ['hello ' => 'world ' ]);
31+ for ($ x = 0 ; $ x < 10 ; $ x ++) {
32+ $ adapter ->publish ('my_channel ' , $ x );
33+ }
You can’t perform that action at this time.
0 commit comments