訊息派發擴充

擴充說明

通道訊息派發器,用於指定執行緒池模型。

擴充埠

org.apache.dubbo.remoting.Dispatcher

擴充組態

<dubbo:protocol dispatcher="xxx" />
<!-- The default value setting, when <dubbo:protocol> does not configure the dispatcher attribute, use this configuration -->
<dubbo:provider dispatcher="xxx" />

已知擴充

  • org.apache.dubbo.remoting.transport.dispatcher.all.AllDispatcher
  • org.apache.dubbo.remoting.transport.dispatcher.direct.DirectDispatcher
  • org.apache.dubbo.remoting.transport.dispatcher.message.MessageOnlyDispatcher
  • org.apache.dubbo.remoting.transport.dispatcher.execution.ExecutionDispatcher
  • org.apache.dubbo.remoting.transport.dispatcher.connection.ConnectionOrderedDispatcher

擴充範例

Maven 專案結構

src
 |-main
    |-java
        |-com
            |-xxx
                |-XxxDispatcher.java (implements the Dispatcher interface)
    |-resources
        |-META-INF
            |-dubbo
                |-org.apache.dubbo.remoting.Dispatcher (plain text file, content: xxx=com.xxx.XxxDispatcher)

XxxDispatcher.java

package com.xxx;
 
import org.apache.dubbo.remoting.Dispatcher;
 
public class XxxDispatcher implements Dispatcher {
    public Group lookup(URL url) {
        //...
    }
}

META-INF/dubbo/org.apache.dubbo.remoting.Dispatcher

xxx=com.xxx.XxxDispatcher

最後修改日期:2023 年 1 月 2 日:增強英文文件 (#1798) (95a9f4f6c1c)