We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
in dubbo, we can write async code like below:
import com.alibaba.dubbo.remoting.exchange.ResponseCallback; import com.alibaba.dubbo.remoting.exchange.ResponseFuture; import com.alibaba.dubbo.rpc.RpcContext; import com.alibaba.dubbo.rpc.protocol.dubbo.FutureAdapter; import com.alibaba.dubbo.rpc.Result; interface TestService { String test(); } testService.test(); ResponseFuture future = ((FutureAdapter) RpcContext.getContext().getFuture()).getFuture(); future.setCallback(new ResponseCallback(){ public void done(Object response){ assert response instanceof Result;// in 2.6.x assert response instanceof String;// in 2.7.x } public void caught(Throwable exception){ } });
however, response is an object of Result in 2.6.x but String in 2.7.x. when project update to 2.7.x, we may find runtime error.
如果我们用上面的代码段做异步调用,在2.7.x里面,response会是一个String,但是在2.6.x,response会是一个com.alibaba.dubbo.rpc.Result。 如果从2.6升级到2.7,必须要查找所有进行调用的地方并修改代码,这不太合理。
The text was updated successfully, but these errors were encountered:
fix compatible problem with FutureAdapter. (apache#6126)
2569a51
No branches or pull requests
Environment
Steps to reproduce this issue
in dubbo, we can write async code like below:
however, response is an object of Result in 2.6.x but String in 2.7.x.
when project update to 2.7.x, we may find runtime error.
如果我们用上面的代码段做异步调用,在2.7.x里面,response会是一个String,但是在2.6.x,response会是一个com.alibaba.dubbo.rpc.Result。
如果从2.6升级到2.7,必须要查找所有进行调用的地方并修改代码,这不太合理。
The text was updated successfully, but these errors were encountered: