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

GO and JAVA cannot communicate with each other due to case issues #13630

Closed
ssfyn opened this issue Jan 9, 2024 · 0 comments
Closed

GO and JAVA cannot communicate with each other due to case issues #13630

ssfyn opened this issue Jan 9, 2024 · 0 comments
Labels
type/need-triage Need maintainers to triage

Comments

@ssfyn
Copy link

ssfyn commented Jan 9, 2024

Environment

  • Server: go: v3.1.0 or v3.1.1-rc1, java: 3.17
  • Client: go: v3.1.0 or v3.1.1-rc1, java: 3.17
  • Protocol: triple
  • Registry: zookeeper (go: interface, java: service+interface)

Issue description

Should the rpc method in the proto file be defined as PascalCase or camelCase?
No matter which one, go and java are currently unable to communicate with each other.

rpc method using PascalCase:

// The greeting service definition.
service GreeterService {
  // Sends a greeting
  rpc Greet(HelloRequest) returns (HelloResponse) {}
}

// The request message containing the user's name.
message HelloRequest {
  string name = 1;
}

// The response message containing the greetings
message HelloResponse {
  string message = 1;
}
result: java client convert method name to camelCase
client server result
go go Success
go java Success
java java java client: throw exception UNIMPLEMENTED : Method : greet not found of service:com.example.triple.service.GreeterService, maybe because java server return status is UNIMPLEMENTED(12)
java go go server: return error cannot find method [greet] of service [com.example.GreeterService] in dubbo

rpc method using camelCase (not followed protobuf style guid):

// The greeting service definition.
service GreeterService {
  // Sends a greeting
  rpc greet(HelloRequest) returns (HelloResponse) {}
}

// The request message containing the user's name.
message HelloRequest {
  string name = 1;
}

// The response message containing the greetings
message HelloResponse {
  string message = 1;
}
result: go server convert method name to PascalCase, but serviceInfo still camelCase
client server result
go go go server: throw error: unknown method Greet for service com.example.GreeterService
go java Success
java java Success
java go go server: throw error: unknown method Greet for service com.example.GreeterService
@ssfyn ssfyn added the type/need-triage Need maintainers to triage label Jan 9, 2024
@ssfyn ssfyn closed this as completed Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/need-triage Need maintainers to triage
Projects
None yet
Development

No branches or pull requests

1 participant