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
版本
升级v2.2版本后,使用config-nacos组件后,启动服务后无法正确获取nacos响应的数据
\Hyperf\Nacos\Provider\ConfigProvider::get() 返回值为空,终端中输出nacos配置信息(http response以stdout形式输出)
// config_center.php //.... 'enable' => (bool) env('CONFIG_CENTER_ENABLE', true), 'driver' => env('CONFIG_CENTER_DRIVER', 'nacos'), 'mode' => env('CONFIG_CENTER_MODE', Mode::PROCESS), 'drivers' => [ 'nacos' => [ 'driver' => Hyperf\ConfigNacos\NacosDriver::class, 'merge_mode' => Hyperf\ConfigNacos\Constants::CONFIG_MERGE_OVERWRITE, 'interval' => 3, 'default_key' => 'sms_config', 'listener_config' => [ 'sms_config' => [ 'tenant' => 'foo', 'data_id' => 'bar', 'group' => 'DEFAULT_GROUP' 'type' => 'json', ], ],
升级swoole v4.6.5版本后问题解决。
// 配置为空导致json:decode抛出异常 #0 /app/vendor/hyperf/config-nacos/src/Client.php(81): Hyperf\Utils\Codec\Json::decode() #1 /app/vendor/hyperf/config-nacos/src/Client.php(67): Hyperf\ConfigNacos\Client->decode() #2 /app/vendor/hyperf/config-center/src/AbstractDriver.php(132): Hyperf\ConfigNacos\Client->pull() #3 /app/vendor/hyperf/config-center/src/AbstractDriver.php(100): Hyperf\ConfigCenter\AbstractDriver->pull()
初步排查是因为guzzlehttp v7.x组件需要高版本swoole
The text was updated successfully, but these errors were encountered:
可以主动安装 guzzle 的 v6.x 版本
也可以自己重写对应的 CoroutineHandler
Sorry, something went wrong.
nacos组件升级v2.2后默认使用Guzzlehttp\Guzzle\Handler\CurlHandler
Guzzlehttp\Guzzle\Handler\CurlHandler
这个handler与swoole的SWOOLE_HOOK_ALL参数存在冲突 swoole/swoole-src#3800
SWOOLE_HOOK_ALL
解决方案: 1、升级swoole版本 >=v4.5.8 , v4.5.8修复 swoole/library#74
2、config-nacos组件v2.2配置中提供guzzle参数,使用CoroutineHandler替代CurlHandler
guzzle
CoroutineHandler
CurlHandler
建议v2.2升级文档提示使用CoroutineHandler替代CurlHandler, 或者hyperf-skeleton要求swoole版本v4.6.0以上 @limingxinleo
hyperf-skeleton
肯定不可能要求4.6以上,如果不用curl,其实4.5也能跑。
你这个场景,毕竟只是很小的一部分
No branches or pull requests
Before you submit this issue, you has been search all existed issues and search the documentation
Describe your question
版本
升级v2.2版本后,使用config-nacos组件后,启动服务后无法正确获取nacos响应的数据
\Hyperf\Nacos\Provider\ConfigProvider::get() 返回值为空,终端中输出nacos配置信息(http response以stdout形式输出)
升级swoole v4.6.5版本后问题解决。
初步排查是因为guzzlehttp v7.x组件需要高版本swoole
The text was updated successfully, but these errors were encountered: