Skip to content
New issue

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

servicecomb由 1.X升级至 2.X 后InvokerUtils.syncInvoke()无法适配场景咨询 #4259

Open
asdxiab opened this issue Mar 1, 2024 · 1 comment

Comments

@asdxiab
Copy link

asdxiab commented Mar 1, 2024

业务网关implements InvocationHandler,在反射中做rpc调用,但是升级servicecomb后 InvokerUtils.syncInvoke方法参数变了,这个有啥办法处理Object[] args 转成 <String, Object> swaggerArguments,尝试过将method中parameters的name做key,但是没发保证arg[]顺序和method入参一致

例如:
public class Invoker implements InvocationHandler {
@OverRide
public Object invoke(Object proxy, Method method, Object[] args) {
Object response = InvokerUtils.syncInvoke(microserviceName,
microserviceSchemaId, microserviceOperationId,args);
}
}

@liubao68
Copy link
Contributor

liubao68 commented Mar 5, 2024

2.x 使用弱类型契约。 需要和 swagger 的参数匹配,而不是服务端的java代码参数匹配。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants