Java interoperability issue, `go-client` call `java-server` failed when calling MetadataService during service discovery.
How to produce:
- demo repo
- start
java-server - start
go-client
Then the following error occurs:
2024-04-05 18:32:42 INFO servicediscovery/service_instances_changed_listener_impl.go:102 Received instance notification event of service greet-java-server, instance list size %!s(int=1)
panic: reflect: call of reflect.Value.MethodByName on zero Value
goroutine 1 [running]:
reflect.Value.MethodByName({0x0?, 0x0?, 0x140003d1f80?}, {0x101988e8e?, 0x0?})
/Users/ken/go/pkg/mod/golang.org/[email protected]/src/reflect/value.go:2112 +0x114
github.com/dubbogo/triple/pkg/triple.getInvoker({0x0?, 0x0?}, 0x12?)
/Users/ken/go/pkg/mod/github.com/dubbogo/[email protected]/pkg/triple/dubbo3_conn.go:79 +0x104
github.com/dubbogo/triple/pkg/triple.NewTripleClient({0x0, 0x0}, 0x101e33f40?)
/Users/ken/go/pkg/mod/github.com/dubbogo/[email protected]/pkg/triple/dubbo3_client.go:117 +0x708
dubbo.apache.org/dubbo-go/v3/protocol/triple.NewDubbo3Invoker(0x140008b2700)
/Users/ken/go/pkg/mod/dubbo.apache.org/dubbo-go/[email protected]/protocol/triple/dubbo3_invoker.go:128 +0x888
dubbo.apache.org/dubbo-go/v3/protocol/triple.(*TripleProtocol).Refer(0x140008c24b0, 0x140008b2700)
/Users/ken/go/pkg/mod/dubbo.apache.org/dubbo-go/[email protected]/protocol/triple/triple.go:117 +0x58
dubbo.apache.org/dubbo-go/v3/metadata/service/local.createProxy({0x102204780, 0x140004012c0})
/Users/ken/go/pkg/mod/dubbo.apache.org/dubbo-go/[email protected]/metadata/service/local/metadata_service_proxy_factory.go:69 +0x124
dubbo.apache.org/dubbo-go/v3/metadata/service.(*BaseMetadataServiceProxyFactory).GetProxy(0x10198174a?, {0x102204780?, 0x140004012c0?})
/Users/ken/go/pkg/mod/dubbo.apache.org/dubbo-go/[email protected]/metadata/service/local_service.go:119 +0x34
I think the problem happened when go-client tries to call MetadataService. But it's strange that it wants to call GetDubboStub method , that's only available when using Protobuf, but obviously in current version, MetadataService is not from Protobuf.
demo is 404, it looks like your java server use triple protocol for metadata service, but now we only support dubbo protocol
Has anyone dealt with this issue? I've encountered this as well.
ref https://github.com/apache/dubbo-go/issues/2403
in fact dubbo java metadataService use the same protocol with user's config unless you config it manually,it means in java-server it use tri as metadata service protocol,but dubbo-go not support tri protocol in metadata service,that's the problem
in java server side,set dubbo.application.metadataServiceProtocol=dubbo to make it work;
fixed in https://github.com/apache/dubbo-go-samples/pull/777