kbac001 commented on issue #15446: URL: https://github.com/apache/dubbo/issues/15446#issuecomment-2961383288
> > > Set `protocol` parameters on annotations,like this: > > > @DubboReference(check=false, > > > protocol="dubbo", > > > stub="org.apache.dubbo.samples.stub.DemoServiceStub", > > > onconnect = "print", > > > interfaceName = "org.apache.dubbo.samples.stub.DemoService") > > > private DemoService demoService; > > > > > > Thanks a lot it worked, but why? I have defined `dubbo.consumer.protocal: dubbo` in application.yml but it doesn't work. > > can u please provider a complete example? Sorry I don’t have more examples, but let me try to explain. From what I understand, if the `protocol` field isn’t set in `@DubboReference` , Dubbo will use the value from the config file — like `dubbo.consumer.protocol` or `dubbo.protocol.name` . And that works fine in most cases when `stub.event` is not involved.(In this issue, when I use `onconnect` , it automatically sets `stub.event` to `true` .) And that’s where my question comes in. Why is `stub.event` treated differently? When I use `onconnect` or `ondisconnect` , why do I have to explicitly set the `protocol` field in `@DubboReference` for it to work? It’s not really explained in the official docs, so I’m not sure if this is expected behavior or a bug. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
