-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
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
解决【dubbo3.0子调用mock结果为null,取不到录制数据】的问题 https://github.com/arextest/are… #491
base: main
Are you sure you want to change the base?
Conversation
@lucas-myx PTAL. |
String version = this.getAttachment("version"); | ||
// splicing:group/interface:version | ||
StringBuilder serviceKey = new StringBuilder(); | ||
if (!StringUtil.isBlank(group)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!StringUtil.isBlank
-> StringUtil.isNotEmpty
serviceKey.append(group).append("/"); | ||
} | ||
serviceKey.append(serviceName); | ||
if (!StringUtil.isBlank(version)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!StringUtil.isBlank
-> StringUtil.isNotEmpty
@@ -38,7 +38,11 @@ public static DubboAdapter of(Invoker<?> invoker, Invocation invocation) { | |||
|
|||
@Override | |||
public String getServiceName() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/**
* format:group/interface:version
* method:org.alibaba.dubbo.common.URL#buildKey()
*/
@Override
public String getServiceName() {
@@ -34,6 +34,7 @@ public static DubboAdapter of(Invoker<?> invoker, Invocation invocation) { | |||
|
|||
@Override | |||
public String getServiceName() { | |||
// format:group/interface:version | |||
return invocation.getTargetServiceUniqueName(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use getUrl().getServiceKey()
?
* <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(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this method can directly use this.getServiceName()
, there is no need to parse it again?
fix #490
可能带来的影响面:
●对dubbo2.0、dubbo3.0的兼容性;
●同时补全对group和version的支持;优化后的完整服务名格式:group/interface:version
●对【忽略mock配置】带来的影响,新的ignore mock path格式可能会导致旧的配置失效;
另外:
如果接受PR,请更新该章节中dubbo服务名的配置说明,最好给出案例