fanliang11 / surging

Surging is a micro-service engine that provides a lightweight, high-performance, modular RPC request pipeline. support Event-based Asynchronous Pattern and reactive programming ,The service engine supports http, TCP, WS,Grpc, Thrift,Mqtt, UDP, and DNS protocols. It uses ZooKeeper and Consul as a registry, and integrates it. Hash, random, polling, Fair Polling as a load balancing algorithm, built-in service governance to ensure reliable RPC communication, the engine contains Diagnostic, link tracking for protocol and middleware calls, and integration SkyWalking Distributed APM
MIT License
3.24k stars 924 forks source link

关于RpcContext获取不到payload的问题 #373

Closed chenhaiqing1985 closed 4 years ago

chenhaiqing1985 commented 4 years ago

通过查看其他issues我知道用RpcContext.GetContext().GetAttachment("payload")来获取payload

看到作者在网关ServicesController中用RpcContext.GetContext().SetAttachment("payload", payload);来传递payload

我调试了作者的Surging.Services.Client,当中也有RpcContext.GetContext().SetAttachment("xid",124);这样在接口中中可以接收到xid

但是我通过网关访问接口,接口中RpcContext.GetContext().GetAttachment("payload")一直是空的,调试中,网关的payload是有值的,在接口里面获取却是null

请问是我使用的问题么,是否需要在接口上配置什么?

目前一直通过继承RequestData来获取payload

fanliang11 commented 4 years ago

图片 没有任何问题,如果你还有疑问,需要远程协助,请购买企业版