Merger Result Extension

Merger Result Extension

Extension Description

Merging return results, used for grouping aggregation.

Extension Interface

org.apache.dubbo.rpc.cluster.Merger

Extension Configuration

  1. <dubbo:method merger="xxx" />

Known Extensions

  • org.apache.dubbo.rpc.cluster.merger.ArrayMerger
  • org.apache.dubbo.rpc.cluster.merger.ListMerger
  • org.apache.dubbo.rpc.cluster.merger.SetMerger
  • org.apache.dubbo.rpc.cluster.merger.MapMerger
  • org.apache.dubbo.rpc.cluster.merger.ByteArrayMerger
  • org.apache.dubbo.rpc.cluster.merger.CharArrayMerger
  • org.apache.dubbo.rpc.cluster.merger.ShortArrayMerger
  • org.apache.dubbo.rpc.cluster.merger.IntArrayMerger
  • org.apache.dubbo.rpc.cluster.merger.LongArrayMerger
  • org.apache.dubbo.rpc.cluster.merger.FloatArrayMerger
  • org.apache.dubbo.rpc.cluster.merger.DoubleArrayMerger
  • org.apache.dubbo.rpc.cluster.merger.BooleanArrayMerger

Extension Example

Maven project structure:

  1. src
  2. |-main
  3. |-java
  4. |-com
  5. |-xxx
  6. |-XxxMerger.java (implements Merger interface)
  7. |-resources
  8. |-META-INF
  9. |-dubbo
  10. |-org.apache.dubbo.rpc.cluster.Merger (plain text file, content: xxx=com.xxx.XxxMerger)

XxxMerger.java:

  1. package com.xxx;
  2. import org.apache.dubbo.rpc.cluster.Merger;
  3. public class XxxMerger<T> implements Merger<T> {
  4. public T merge(T... results) {
  5. // ...
  6. }
  7. }

META-INF/dubbo/org.apache.dubbo.rpc.cluster.Merger:

  1. xxx=com.xxx.XxxMerger

Feedback

Was this page helpful?

Yes No

Last modified September 30, 2024: Update & Translate Overview Docs (#3040) (d37ebceaea7)