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

Java interoperability issue, go-client call java-server failed when calling MetadataService during service discovery. #2653

Closed
chickenlj opened this issue Apr 5, 2024 · 5 comments

Comments

@chickenlj
Copy link
Contributor

How to produce:

  1. demo repo
  2. start java-server
  3. 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/toolchain@v0.0.1-go1.22.1.darwin-arm64/src/reflect/value.go:2112 +0x114
github.com/dubbogo/triple/pkg/triple.getInvoker({0x0?, 0x0?}, 0x12?)
        /Users/ken/go/pkg/mod/github.com/dubbogo/triple@v1.2.2-rc3/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/triple@v1.2.2-rc3/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/v3@v3.2.0-rc1/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/v3@v3.2.0-rc1/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/v3@v3.2.0-rc1/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/v3@v3.2.0-rc1/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.

image

@FoghostCn
Copy link
Contributor

demo is 404, it looks like your java server use triple protocol for metadata service, but now we only support dubbo protocol

@cnmac
Copy link

cnmac commented Jul 11, 2024

Has anyone dealt with this issue? I've encountered this as well.

@FoghostCn
Copy link
Contributor

ref #2403

@FoghostCn
Copy link
Contributor

FoghostCn commented Jul 12, 2024

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;

@FoghostCn
Copy link
Contributor

fixed in apache/dubbo-go-samples#777

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants