-
Notifications
You must be signed in to change notification settings - Fork 120
解决【dubbo3.0子调用mock结果为null,取不到录制数据】的问题 https://github.com/arextest/are… #491
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. why not use |
||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,7 +118,31 @@ public Map<String, String> getRequestHeaders() { | |
} | ||
|
||
public String getPath() { | ||
return StringUtil.defaultIfEmpty(getAttachment("path"), getServiceName()); | ||
return StringUtil.defaultIfEmpty(this.getServiceNameWithVersion(), this.getServiceName()); | ||
} | ||
|
||
/** | ||
* <p>Illustrate: Splicing serviceName and version | ||
* <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 commentThe reason will be displayed to describe this comment to others. Learn more. I think this method can directly use |
||
String serviceName = this.getAttachment("path"); | ||
if (StringUtil.isBlank(serviceName)){ | ||
return null; | ||
} | ||
String group = this.getValByKey("group"); | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
serviceKey.append(group).append("/"); | ||
} | ||
serviceKey.append(serviceName); | ||
if (!StringUtil.isBlank(version)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
serviceKey.append(":").append(version); | ||
} | ||
return serviceKey.toString(); | ||
} | ||
|
||
/** | ||
|
Uh oh!
There was an error while loading. Please reload this page.
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.