解决【dubbo3.0子调用mock结果为null,取不到录制数据】的问题 https://github.com/arextest/are…#491
Open
JCACJY wants to merge 1 commit intoarextest:mainfrom
Open
解决【dubbo3.0子调用mock结果为null,取不到录制数据】的问题 https://github.com/arextest/are…#491JCACJY wants to merge 1 commit intoarextest:mainfrom
JCACJY wants to merge 1 commit intoarextest:mainfrom
Conversation
Collaborator
|
@lucas-myx PTAL. |
lucas-myx
reviewed
Jun 12, 2024
| String version = this.getAttachment("version"); | ||
| // splicing:group/interface:version | ||
| StringBuilder serviceKey = new StringBuilder(); | ||
| if (!StringUtil.isBlank(group)) { |
Collaborator
There was a problem hiding this comment.
!StringUtil.isBlank -> StringUtil.isNotEmpty
lucas-myx
reviewed
Jun 12, 2024
| serviceKey.append(group).append("/"); | ||
| } | ||
| serviceKey.append(serviceName); | ||
| if (!StringUtil.isBlank(version)) { |
Collaborator
There was a problem hiding this comment.
!StringUtil.isBlank -> StringUtil.isNotEmpty
lucas-myx
reviewed
Jun 12, 2024
| @@ -38,7 +38,11 @@ public static DubboAdapter of(Invoker<?> invoker, Invocation invocation) { | |||
|
|
|||
| @Override | |||
| public String getServiceName() { | |||
Collaborator
There was a problem hiding this comment.
/**
* format:group/interface:version
* method:org.alibaba.dubbo.common.URL#buildKey()
*/
@Override
public String getServiceName() {
lucas-myx
reviewed
Jun 12, 2024
| @Override | ||
| public String getServiceName() { | ||
| // format:group/interface:version | ||
| return invocation.getTargetServiceUniqueName(); |
Collaborator
There was a problem hiding this comment.
why not use getUrl().getServiceKey()?
lucas-myx
reviewed
Jun 12, 2024
| * <p>Fix Bug: https://github.com/arextest/arex-agent-java/issues/490 | ||
| * <p>Notice: This method maybe affect ignore [path] config! Especially when a dubbo service exists multiple versions! | ||
| */ | ||
| protected String getServiceNameWithVersion(){ |
Collaborator
There was a problem hiding this comment.
I think this method can directly use this.getServiceName(), there is no need to parse it again?
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.
fix #490
可能带来的影响面:
●对dubbo2.0、dubbo3.0的兼容性;
●同时补全对group和version的支持;优化后的完整服务名格式:group/interface:version
●对【忽略mock配置】带来的影响,新的ignore mock path格式可能会导致旧的配置失效;
另外:
如果接受PR,请更新该章节中dubbo服务名的配置说明,最好给出案例