Echo Test

Check whether Dubbo service is available by echo test

Feature description

The echo test is used to detect whether the service is available. The echo test is performed according to the normal request process. It can test whether the entire call is smooth and can be used for monitoring.

Reference use case

https://github.com/apache/dubbo-samples/tree/master/dubbo-samples-echo

scenes to be used

How to use

All services automatically implement the EchoService interface, just cast any service reference to EchoService to use it.

Spring configuration

<dubbo:reference id="memberService" interface="com.xxx.MemberService" />

code

// remote service reference
MemberService memberService = ctx. getBean("memberService");
 
EchoService echoService = (EchoService) memberService; // Mandatory transformation to EchoService

// echo test availability
String status = echoService. $echo("OK");
 
assert(status. equals("OK"));

Last modified January 2, 2023: Enhance en docs (#1798) (95a9f4f6c1)