• php kafka rdkafka扩展使用


    2020-9-7 14:18:37 星期一

    PHP官方的kafka扩展是 rdkafka;

    kafka PHP官方扩展文档: https://arnaud.le-blanc.net/php-rdkafka-doc/phpdoc/book.rdkafka.html
    kafka 配置项的官方说明: https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md
    下载扩展: http://pecl.php.net/package/rdkafka
    windows 安装扩展: https://arnaud.le-blanc.net/php-rdkafka-doc/phpdoc/rdkafka.installation.windows.html

    4.0以后的版本有一个重要改动:

    BREAKING CHANGE: Since version 4.0, the client no longer polls for network
    events at shutdown (during object destructor). This behaviour didn't give
    enough control to the user in case of server issue, and could cause the script
    to hang while terminating.
    
    Starting from 4.0, programs MUST call flush() before shutting down, otherwise
    some messages and callbacks may be lost.

    简单翻译一下: 

    对于4.0以后的版本, 客户端对象销毁的时候, 不再检查处理(poll)网络事件了, 因为如果服务器有问题, 用户也干不了啥, 而且会导致脚本挂起;

    以后在程序停掉之前必须调用 flush()方法, 否则会导致消息丢失.

    ==============

    如果报错 Segmentation fault (core dumped)  检查一下是不是topic没有配置或者其他配置项配置错误了 (php5.6 rdkafka 4.0.2)

  • 相关阅读:
    质量数据统计报表
    Gitlab CR
    搭建openstf平台的那些事
    wrk 使用记录及踩过的坑
    无题,表达一下心情
    theano中对图像进行convolution 运算
    4d tensor
    theano中的concolutional_mlp.py学习
    theano中的logisticregression代码学习
    利用Anaconda安装python后,如何安装opencv-python
  • 原文地址:https://www.cnblogs.com/iLoveMyD/p/13626777.html
Copyright © 2020-2023  润新知