Skip to content
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

Fix proto package and java_package issue #13559

Merged
merged 9 commits into from
Dec 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,12 @@ public abstract class AbstractServiceConfig extends AbstractInterfaceConfig {
*/
private Integer payload;

/**
* Whether to use java_package in IDL as path. Default use package.
* This param only available when service using native stub.
*/
private Boolean useJavaPackageAsPath;

public AbstractServiceConfig() {}

public AbstractServiceConfig(ModuleModel moduleModel) {
Expand All @@ -170,7 +176,9 @@ protected void checkDefault() {
if (dynamic == null) {
dynamic = true;
}

if (useJavaPackageAsPath == null) {
useJavaPackageAsPath = false;
}
if (StringUtils.isBlank(preferSerialization)) {
preferSerialization = serialization;
}
Expand Down Expand Up @@ -388,4 +396,13 @@ public Integer getPayload() {
public void setPayload(Integer payload) {
this.payload = payload;
}

public Boolean getUseJavaPackageAsPath() {
return useJavaPackageAsPath;
}

@Parameter(excluded = true)
public void setUseJavaPackageAsPath(Boolean useJavaPackageAsPath) {
this.useJavaPackageAsPath = useJavaPackageAsPath;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,10 @@ private void doExportUrls(RegisterTypeEnum registerType) {
final boolean serverService = ref instanceof ServerService;
if (serverService) {
serviceDescriptor = ((ServerService) ref).getServiceDescriptor();
if (!this.provider.getUseJavaPackageAsPath()) {
// for stub service, path always interface name or IDL package name
this.path = serviceDescriptor.getInterfaceName();
}
repository.registerService(serviceDescriptor);
} else {
serviceDescriptor = repository.registerService(getInterfaceClass());
Expand Down
Loading