dubbo icon indicating copy to clipboard operation
dubbo copied to clipboard

[Bug] Dubbo 2.7.23 Consumer not consuming properly when provider custom extends Dispatcher

Open pudding0928 opened this issue 1 year ago • 2 comments

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 SPI Extensions (apache/dubbo-spi-extensions)

Dubbo Version

Dubbo Java 2.7.23,openJdk 1.11

Steps to reproduce this issue

1 CustomDispatcher implements Dispatcher and implements the related methods. 2 In the META-INF/dubbo directory, create a new file with the name org.apache.dubbo.remote.Dispatcher, with the content custom=com.xx.xx.CustomDispatcher 3 Call ProtocolConfig's setDispatcher method to set it to custom: protocolConfig.setDispatcher("custom") 4 start Provider sucessfully 5 When starting the consumer, it encounters the no provider error, and when tracing it through the debug, I found that when creating the NettyClient object, it calls org.apache.dubbo.remote.transport.dispatcher.ChannelHandlers#. wrapInternal -> ExtensionLoader.getExtensionLoader(Dispatcher.class) .getAdaptiveExtension() can't find the class CustomDispatcher and gives error PS: This error is not encountered when the Dispatcher's implementation class is changed to the built-in configuration.

What you expected to happen

The client-side Dispatcher should not be bound strictly and consistently to the server-side. If this is the case, there is no way to optimise the server-side Dispatcher schema when the client-side code is unable to make a task change that needs to be done

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

pudding0928 avatar Sep 11 '24 06:09 pudding0928

You'd better not to customize dispatcher

AlbumenJ avatar Sep 11 '24 09:09 AlbumenJ

You'd better not to customize dispatcher

thanks,I accept your suggestion. I just customize a dispatcher that extends MessageOnlyDispatcher and makes a few changes about RejectedExecutionException. It does't affect the main process of MessageOnlyDispatcher. So,how should I do? @AlbumenJ

pudding0928 avatar Sep 12 '24 01:09 pudding0928