You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2020/03/13 09:37:22 UTC

[GitHub] [dubbo-js] zewade opened a new issue #205: 请问Dubbo.js是否支持调用后端的回声测试接口?

zewade opened a new issue #205: 请问Dubbo.js是否支持调用后端的回声测试接口?
URL: https://github.com/apache/dubbo-js/issues/205
 
 
   你好,我们这边可能想调用dubbo内置的回声测试接口。但看了一下dubbo.js似乎没办法调用api包之外的接口,想确定一下是否有办法调用回声测试接口。
   
   回声测试用于检测服务是否可用,可以使用启动检查的check配置,也可以从代码中检测,dubbo中的所有服务自动实现EchoService接口,所以可以将任意的服务类型强转为EchoService
   Spring配置
   
   
   <dubbo:reference id="memberService" interface="com.xxx.MemberService" />
   调用代码:
   
   HelloService helloService = ctx.getBean("helloService"); 
   EchoService echoService = (EchoService) helloService; // 强制转型为EchoService
   // 回声测试可用性
   String status = echoService.$echo("OK"); 
   assert(status.equals("OK"));

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org