The config of services.providers.address is unavailable for RPC Client#115
Closed
junler wants to merge 4 commits intohyperf:masterfrom
junler:patch-6
Closed
The config of services.providers.address is unavailable for RPC Client#115junler wants to merge 4 commits intohyperf:masterfrom junler:patch-6
services.providers.address is unavailable for RPC Client#115junler wants to merge 4 commits intohyperf:masterfrom
junler:patch-6
Conversation
添加兼容consul包Client类中request方法的$options参数为空的情况,此处如果不加$options参数,之前在guzzlehttp的Client类的base_uri就会被覆盖!
兼容传入$options['base_uri']参数时$params['query']为空的情况
接收$options参数,避免guzzlehttp的Client类的base_uri被覆盖。现在的代码逻辑是consul包Client类中request方法的$options参数为空的情况就会使用默认的base_uri。
Member
|
Agent::services() 是实现了对应接口的,顺便修改一下 AgentInterface |
services()添加可选参数$options
Contributor
Author
|
已修改 AgentInterface 的services方法 |
Member
|
@jungeFight 我还是不太理解这个问题要解决的点,你可以举一个使用场景并附上代码说明一下,如果不做此改动,出现问题是什么吗? |
Contributor
Author
|
@huangzhhui 你可以初始化一个hyperf-skeleton的项目,用json-rpc调用发布到 consul的服务,就会发现services.php配置文件中的address值在request的时候会被覆盖! |
services.providers.address is unavailable for RPC Client
Member
|
我去检查了这部分逻辑,我发现最终 request 确实会覆盖 base_uri。 |
Member
|
refer #139 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修复services.php配置文件中address会被DEFAULT_URI覆盖的情况!