We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
只能连本机的9092端口,连接远程会提示:Could not connect to tcp://localhost:9092 (Connection refused [111]) File:...../vendor/longlang/phpkafka/src/Socket/SwooleSocket.php Line:95 我的ip和端口号都不是localhost和9092,不知道为什么还是会连接到localhost:9092上
自建,尝试使用华为云的kafka会报一个内存溢出的错误,所以先放弃了,华为云的提示为allowed memory size of 134... bytes exhausted... File:../longlang/phpkafka/src/Broker.php Line136
php -v & php --ri swoole & composer info | grep longlang/phpkafka
# 粘贴到这里 [1] 22822 [2] 22823 PHP 7.3.27 (cli) (built: Apr 10 2021 14:10:50) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.27, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.3.27, Copyright (c) 1999-2018, by Zend Technologies swoole Swoole => enabled Author => Swoole Team <team@swoole.com> Version => 4.6.5 Built => Apr 20 2021 10:16:05 coroutine => enabled with boost asm context epoll => enabled eventfd => enabled signalfd => enabled cpu_affinity => enabled spinlock => enabled rwlock => enabled zlib => 1.2.11 mutex_timedlock => enabled pthread_barrier => enabled futex => enabled async_redis => enabled Directive => Local Value => Master Value swoole.enable_coroutine => On => On swoole.enable_library => On => On swoole.enable_preemptive_scheduler => Off => Off swoole.display_errors => On => On swoole.use_shortname => On => On swoole.unixsock_buffer_size => 8388608 => 8388608 Composer could not find a composer.json file in /usr/src/app/example To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section [1]- Done php -v [2]+ Done php --ri swoole * 提供最小可复现代码: ```php $config = new ProducerConfig(); $config->setBootstrapServer(['124.xxx.xxx.xxx,9095']); $config->setUpdateBrokers(true); $config->setAcks(-1); $producer = new Producer($config); $topic = 'test333'; $value = (string) microtime(true); $key = uniqid('', true); $producer->send($topic, $value, $key);
The text was updated successfully, but these errors were encountered:
longlang/phpkafka 版本是否最新?
如果有内存溢出,请提供完整调用堆栈。
localhost 问题和你的 kafka 配置有关
Sorry, something went wrong.
收到,谢谢,phpkafka是最新的.华为云的问题我作一个最纯粹的测试再发结果,目前在框架中运行,担心会受到框架的影响.
kafka的配置添加了listeners后不会报错了.华为云的Kafka连接还是有问题,简单修改了下broker.php136行的(临时取消array_merge作测试以确认问题),又报Protocol/Type/Int16.php 43行内存溢出(unpack(self::FORAMT, $value)[1]那段),待进一步确认.
华为云的phpkafka已确认可以正常使用,需要在华为云的Kafka实例中开启"自动创建topics"即可,这样就不会报内存溢出的错误了.
No branches or pull requests
只能连本机的9092端口,连接远程会提示:Could not connect to tcp://localhost:9092 (Connection refused [111]) File:...../vendor/longlang/phpkafka/src/Socket/SwooleSocket.php Line:95
我的ip和端口号都不是localhost和9092,不知道为什么还是会连接到localhost:9092上
自建,尝试使用华为云的kafka会报一个内存溢出的错误,所以先放弃了,华为云的提示为allowed memory size of 134... bytes exhausted... File:../longlang/phpkafka/src/Broker.php Line136
The text was updated successfully, but these errors were encountered: