Dubbo proxy

The dubbo proxy filter decodes the RPC protocol between dubbo clients and servers. the decoded RPC information is converted to metadata. the metadata includes the basic request ID, request type, serialization type, and the required service name, method name, parameter name, and parameter value for routing.

  • v2 API reference
  • This filter should be configured with the name envoy.filters.network.dubbo_proxy.

Statistics

Every configured dubbo proxy filter has statistics rooted at redis.. with the following statistics:

NameTypeDescription
requestCounterTotal requests
request_twowayCounterTotal twoway requests
request_onewayCounterTotal oneway requests
request_eventCounterTotal event requests
request_decoding_errorCounterTotal decoding error requests
request_decoding_successCounterTotal decoding success requests
request_activeGaugeTotal active requests
responseCounterTotal responses
response_successCounterTotal success responses
response_errorCounterTotal responses that protocol parse error
response_error_caused_connection_closeCounterTotal responses that caused by the downstream connection close
response_business_exceptionCounterTotal responses that the protocol contains exception information returned by the business layer
response_decoding_errorCounterTotal decoding error responses
response_decoding_successCounterTotal decoding success responses
response_errorCounterTotal responses that protocol parse error
local_response_successCounterTotal local responses
local_response_errorCounterTotal local responses that encoding error
local_response_business_exceptionCounterTotal local responses that the protocol contains business exception
cx_destroy_local_with_active_rqCounterConnections destroyed locally with an active query
cx_destroy_remote_with_active_rqCounterConnections destroyed remotely with an active query

Implement custom filter based on the dubbo proxy filter

If you want to implement a custom filter based on the dubbo protocol, the dubbo proxy filter like HTTP also provides a very convenient way to expand, the first step is to implement the DecoderFilter interface, and give the filter named, such as testFilter, the second step is to add your configuration, configuration method refer to the following sample

  1. filter_chains:
  2. - filters:
  3. - name: envoy.filters.network.dubbo_proxy
  4. config:
  5. stat_prefix: dubbo_incomming_stats
  6. protocol_type: Dubbo
  7. serialization_type: Hessian2
  8. route_config:
  9. name: local_route
  10. interface: org.apache.dubbo.demo.DemoService
  11. routes:
  12. - match:
  13. method:
  14. name:
  15. exact: sayHello
  16. route:
  17. cluster: user_service_dubbo_server
  18. dubbo_filters:
  19. - name: envoy.filters.dubbo.testFilter
  20. config:
  21. "@type": type.googleapis.com/google.protobuf.Struct
  22. value:
  23. name: test_service
  24. - name: envoy.filters.dubbo.router