Dubbo 配置rest服务时报错,配置为
<dubbo:service interface="com.biz.service.rest.RestService"
ref="restService" version="1.0.0" protocol="rest" timeout="1000"/>
调用rest接口时始终报错
Internal server error: Invalid token! Forbid invoke remote service interface com.biz.service.rest.RestServicemethod back() from consumer 0:0:0:0:0:0:0:1 to provider 172.24.82.37
是因为dubbo的token验证机制默认是开启的,修改发布服务配置添加 token="false",问题解决
<dubbo:service interface="com.biz.service.rest.RestService"
ref="restService" version="1.0.0" protocol="rest" timeout="1000" token="false"/>