File tree Expand file tree Collapse file tree 11 files changed +89
-214
lines changed
Expand file tree Collapse file tree 11 files changed +89
-214
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " ayhome/kafka" ,
3+ "description" : " kafka-php-lite" ,
4+ "type" : " library" ,
5+ "authors" : [
6+ {
7+ "name" : " ayhome" ,
8+ "email" : " ayhome@foxmail.com"
9+ }
10+ ],
11+ "require" : {}
12+ }
Original file line number Diff line number Diff line change 11<?php
2- // Copyright 2016 The See-KafKa Authors. All rights reserved.
3- //
4- // Licensed under the Apache License, Version 2.0 (the "License"): you may
5- // not use this file except in compliance with the License. You may obtain
6- // a copy of the License at
7- //
8- // http://www.apache.org/licenses/LICENSE-2.0
9- //
10- // Unless required by applicable law or agreed to in writing, software
11- // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12- // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13- // License for the specific language governing permissions and limitations
14- // under the License.
2+ namespace ayhome \KafKa ;
153
164// 通过offset和group来获取消息(必须设置group)
175const KAFKA_OFFSET_STORED = RD_KAFKA_OFFSET_STORED ;
2513 * KafKa-Consumer类
2614 * @author : @喵了个咪<wenzhenxi@vip.qq.com>
2715 */
28- class KafKa_Consumer {
16+ class Consumer {
2917
3018 protected $ topic = null ;
3119
Original file line number Diff line number Diff line change 11<?php
2- // Copyright 2016 The See-KafKa Authors. All rights reserved.
3- //
4- // Licensed under the Apache License, Version 2.0 (the "License"): you may
5- // not use this file except in compliance with the License. You may obtain
6- // a copy of the License at
7- //
8- // http://www.apache.org/licenses/LICENSE-2.0
9- //
10- // Unless required by applicable law or agreed to in writing, software
11- // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12- // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13- // License for the specific language governing permissions and limitations
14- // under the License.
15-
16- /**
17- * KafKa拓展类
18- * @author : @喵了个咪<wenzhenxi@vip.qq.com>
19- * 依赖PHP-C拓展:https://github.com/arnaud-lb/php-rdkafka
20- * 依赖服务底层:https://github.com/edenhill/librdkafka
21- * setKafkaConf和setTopicConf配置说明地址:
22- * https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md
23- */
2+ namespace ayhome \KafKa ;
243
254// KafKa分区自动随机分配
265const KAFKA_PARTITION_UA = RD_KAFKA_PARTITION_UA ;
276
28- class KafKa_Lite {
7+ class KafKa {
298
309 // KafKaHostList
3110 protected $ BrokerList = array ();
Original file line number Diff line number Diff line change 1+ <?php
2+ namespace ayhome \KafKa ;
3+ class Message
4+ {
5+ /**
6+ * @var int
7+ */
8+ public $ err ;
9+
10+ /**
11+ * @var string
12+ */
13+ public $ topic_name ;
14+
15+ /**
16+ * @var int
17+ */
18+ public $ partition ;
19+
20+ /**
21+ * @var string
22+ */
23+ public $ payload ;
24+
25+ /**
26+ * @var string
27+ */
28+ public $ key ;
29+
30+ /**
31+ * @var int
32+ */
33+ public $ offset ;
34+
35+ /**
36+ * @return string
37+ */
38+ public function errstr ()
39+ {
40+ }
41+ }
You can’t perform that action at this time.
0 commit comments