Pre-check

  • [x] I am sure that all the content I provide is in English.

Search before asking

  • [x] I had searched in the issues and found no similar issues.

Apache Dubbo Component

Java SDK (apache/dubbo)

Dubbo Version

Dubbo Java 3.3.4, Java 21, macOS 15.5

Steps to reproduce this issue

Generated source code Dubbo<ServiceName>Triple has a conflict class usage when the proto file name is message.proto, which generates a Message.java, it's conflicted with the protobuf buildin class, dubbo doesn't handle the full class name correctly, the static code generated by dubbo use the simple class name.


public final class DubboServiceNameTriple {

    public static final String SERVICE_NAME = ServiceName.SERVICE_NAME;

    private static final StubServiceDescriptor serviceDescriptor = new StubServiceDescriptor(SERVICE_NAME, ServiceName.class);

    static {
        org.apache.dubbo.rpc.protocol.tri.service.SchemaDescriptorRegistry.addSchemaDescriptor(SERVICE_NAME, Message.getDescriptor()); // !!!
        StubSuppliers.addSupplier(SERVICE_NAME, DubboServiceNameTriple::newStub);
        StubSuppliers.addSupplier(ServiceName.JAVA_SERVICE_NAME,  DubboServiceNameTriple::newStub);
        StubSuppliers.addDescriptor(SERVICE_NAME, serviceDescriptor);
        StubSuppliers.addDescriptor(ServiceName.JAVA_SERVICE_NAME, serviceDescriptor);
    }

What you expected to happen

Handle the generated code class name correctly.

Anything else

No response

Are you willing to submit a pull request to fix on your own?

  • [ ] Yes I am willing to submit a pull request on my own!

Code of Conduct

Comment From: wcy666103

I think on the basis of the characteristics of Dubbo IDL, should try to avoid using message. The proto named, as you can see in the Triple inevitable imported com. Google. Protobuf. Message There are compatibility issues if the whole logic is modified.

Comment From: hu-chia

Avoid to use message as the filename is an easy workaround.

Comment From: hu-chia

I suspect fix this issue is not a very huge change, all we should do is that use the full qualified name to refer generated classes, I cannot see any compatibility issues here.