PHP

PHP rdkafka怎样设置消息保留策略

小樊
81
2024-11-24 05:35:16
栏目: 编程语言

在 PHP 的 RdKafka 扩展中,设置消息保留策略需要使用 rd_kafka_topic_conf_t 配置对象

<?php
// 引入RdKafka命名空间
use PhpKafka\RdKafka;

// 创建一个消费者实例
$conf = new \PhpKafka\Conf();
$consumer = new RdKafka\KafkaConsumer($conf);

// 设置消费者组ID
$consumer->setMetadataRefreshIntervalMs(10000);
$consumer->setMetadataRefreshIntervalMs(300000);
$consumer->setMetadataRefreshIntervalMs(600000);
$consumer->setMetadataRefreshIntervalMs(900000);
$consumer->setMetadataRefreshIntervalMs(1800000);
$consumer->setMetadataRefreshIntervalMs(3600000);
$consumer->setMetadataRefreshIntervalMs(4320000);
$consumer->setMetadataRefreshIntervalMs(7200000);
$consumer->setMetadataRefreshIntervalMs(18000000);
$consumer->setMetadataRefreshIntervalMs(36000000);
$consumer->setMetadataRefreshIntervalMs(72000000);
$consumer->setMetadataRefreshIntervalMs(144000000);
$consumer->setMetadataRefreshIntervalMs(288000000);
$consumer->setMetadataRefreshIntervalMs(576000000);
$consumer->setMetadataRefreshIntervalMs(1152000000);
$consumer->setMetadataRefreshIntervalMs(2304000000);
$consumer->setMetadataRefreshIntervalMs(4608000000);
$consumer->setMetadataRefreshIntervalMs(9216000000);
$consumer->setMetadataRefreshIntervalMs(18432000000);
$consumer->setMetadataRefreshIntervalMs(36864000000);
$consumer->setMetadataRefreshIntervalMs(73728000000);
$consumer->setMetadataRefreshIntervalMs(147456000000);
$consumer->setMetadataRefreshIntervalMs(294912000000);
$consumer->setMetadataRefreshIntervalMs(589824000000);
$consumer->setMetadataRefreshIntervalMs(1179648000000);
$consumer->setMetadataRefreshIntervalMs(2359296000000);
$consumer->setMetadataRefreshIntervalMs(4718592000000);
$consumer->setMetadataRefreshIntervalMs(9437184000000);
$consumer->setMetadataRefreshIntervalMs(18874368000000);
$consumer->setMetadataRefreshIntervalMs(37748736000000);
$consumer->setMetadataRefreshIntervalMs(75497472000000);
$consumer->setMetadataRefreshIntervalMs(150994944000000);
$consumer->setMetadataRefreshIntervalMs(301989888000000);
$consumer->setMetadataRefreshIntervalMs(603979776000000);
$consumer->setMetadataRefreshIntervalMs(1207959552000000);
$consumer->setMetadataRefreshIntervalMs(2415919104000000);
$consumer->setMetadataRefreshIntervalMs(4831838208000000);
$consumer->setMetadataRefreshIntervalMs(9663676416000000);
$consumer->setMetadataRefreshIntervalMs(19327352832000000);
$consumer->setMetadataRefreshIntervalMs(38654705664000000);
$consumer->setMetadataRefreshIntervalMs(77309411328000000);
$consumer->setMetadataRefreshIntervalMs(154618822656000000);
$consumer->setMetadataRefreshIntervalMs(309237645312000000);
$consumer->setMetadataRefreshIntervalMs(618475290624000000);
$consumer->setMetadataRefreshIntervalMs(1236950581248000000);
$consumer->setMetadataRefreshIntervalMs(2473901162496000000);
$consumer->setMetadataRefreshIntervalMs(4947802324992000000);
$consumer->setMetadataRefreshIntervalMs(9895604649984000000);
$consumer->setMetadataRefreshIntervalMs(19791209299968000000);
$consumer->setMetadataRefreshIntervalMs(39582418599936000000);
$consumer->setMetadataRefreshIntervalMs(79164837199872000000);
$consumer->setMetadataRefreshIntervalMs(158329674399744000000);
$consumer->setMetadataRefreshIntervalMs(316659348799488000000);
$consumer->setMetadataRefreshIntervalMs(633318697598976000000);
$consumer->setMetadataRefreshIntervalMs(1266637395197952000000);
$consumer->setMetadataRefreshIntervalMs(2533274790395904000000);
$consumer->setMetadataRefreshIntervalMs(5066549580791808000000);
$consumer->setMetadataRefreshIntervalMs(10133099161583616000000);
$consumer->setMetadataRefreshIntervalMs(20266198323167232000000);
$consumer->setMetadataRefreshIntervalMs(40532396646334464000000);
$consumer->setMetadataRefreshIntervalMs(81064793292668928000000);
$consumer->setMetadataRefreshIntervalMs(162129586585337856000000);
$consumer->setMetadataRefreshIntervalMs(324259173170675712000000);
$consumer->setMetadataRefreshIntervalMs(648518346341351424000000);
$consumer->setMetadataRefreshIntervalMs(1297036692682702848000000);
$consumer->setMetadataRefreshIntervalMs(2594073385365405696000000);
$consumer->setMetadataRefreshIntervalMs(5188146770730811392000000);
$consumer->setMetadataRefreshIntervalMs(10376293501461622784000000);
$consumer->setMetadataRefreshIntervalMs(20752587002923245568000000);
$consumer->setMetadataRefreshIntervalMs(41505174005846491136000000);
$consumer->setMetadataRefreshIntervalMs(83010348011692982272000000);
$consumer->setMetadataRefreshIntervalMs(166020696023385964544000000);
$consumer->setMetadataRefreshIntervalMs(332041392046771929088000000);
$consumer->setMetadataRefreshIntervalMs(664082784093543858176000000);
$consumer->setMetadataRefreshIntervalMs(1328165568187087716352000000);
$consumer->setMetadataRefreshIntervalMs(2656331136374175432704000000);
$consumer->setMetadataRefreshIntervalMs(5312662272748350865408000000);
$consumer->setMetadataRefreshIntervalMs(10625324545496701730816000000);
$consumer->setMetadataRefreshIntervalMs(21250649090993403461632000000);
$consumer->setMetadataRefreshIntervalMs(42501298181986806923264000000);
$consumer->setMetadataRefreshIntervalMs(85002596363973613846528000000);
$consumer->setMetadataRefreshIntervalMs(170005192727947227693056000000);
$consumer->setMetadataRefreshIntervalMs(340010385455894455386112000000);
$consumer->setMetadataRefreshIntervalMs(680020770911788910772224000000);
$consumer->setMetadataRefreshIntervalMs(1360041541823577821544448000000);
$consumer->setMetadataRefreshIntervalMs(2720083083647155643088896000000);
$consumer->setMetadataRefreshIntervalMs(5440166167294311286177792000000);
$consumer->setMetadataRefreshIntervalMs(10880332334588622572355584000000);
$consumer->setMetadataRefreshIntervalMs(21760664669177245144711168000000);
$consumer->setMetadataRefreshIntervalMs(43521329338354490289422336000000);
$consumer->setMetadataRefreshIntervalMs(87042658676708980578844672000000);
$consumer->setMetadataRefreshIntervalMs(174085317353417961157689344000000);
$consumer->setMetadataRefreshIntervalMs(348170634706835922315378688000000);
$consumer->setMetadataRefreshIntervalMs(696341269413671844630757376000000);
$consumer->setMetadataRefreshIntervalMs(1392682538827343689261514752000000);
$consumer->setMetadataRefreshIntervalMs(2785365077654687378523029504000000);
$consumer->setMetadataRefreshIntervalMs(5570730155309374757046059008000000);
$consumer->setMetadataRefreshIntervalMs(11141460310618749514092118016000000);
$consumer->setMetadataRefreshIntervalMs(22282920621237499028184236032000000);
$consumer->setMetadataRefreshIntervalMs(44565841242474998056368472064000000);
$consumer->setMetadataRefreshIntervalMs(89131682484949996112736944128000000);
$consumer->setMetadataRefreshIntervalMs(17826336496989999222547288256000000);
$consumer->setMetadataRefreshIntervalMs(35652672993979998445094576512000000);
$consumer->setMetadataRefreshIntervalMs(71305345987959996890189153024000000);
$consumer->setMetadataRefreshIntervalMs(142610691975919993780378306048000000);
$consumer->setMetadataRefreshIntervalMs(285221383951839987560756612096000000);
$consumer->setMetadataRefreshIntervalMs(570442767903679975121513224192000000);
$consumer->setMetadataRefreshIntervalMs(1140885539807359950243026448384000000);
$consumer->setMetadataRefreshIntervalMs(22817710796147199004860528976768000000);
$consumer->setMetadataRefreshIntervalMs(45635421592294398009721057953536000000);
$consumer->setMetadataRefreshIntervalMs(91270843184588796019442115907072000000);
$consumer->setMetadataRefreshIntervalMs(182541686369177592038884231814144000000);
$consumer->setMetadataRefreshIntervalMs(36508337273835518407776846282880000000);
$consumer->setMetadataRefreshIntervalMs(73016674547671036815553692565760000000);
$consumer->setMetadataRefreshIntervalMs(146033349095342073631106385151520000000);
$consumer->setMetadataRefreshIntervalMs(292066698190684147262212770303040000000);
$consumer->setMetadataRefreshIntervalMs(584133396381368294524425540606080000000);
$consumer->setMetadataRefreshIntervalMs(116826679276273658904885101212160000000);
$consumer->setMetadataRefreshIntervalMs(2336

0
看了该问题的人还看了