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 2018/08/28 03:57:55 UTC
[GitHub] caneo removed a comment on issue #1054: Provider cannot get the
application parameter of consumer's url
caneo removed a comment on issue #1054: Provider cannot get the application parameter of consumer's url
URL: https://github.com/apache/incubator-dubbo/issues/1054#issuecomment-416435297
1) 配置xml文件:在comsumer.xml中application name属性定义了应用名
<dubbo:application name="demo-provider"/>
2) RpcContext: RpcContext中存在attachments字段,以key-value的形式支持开发者扩展字段值。
3) ComsumerContextFilter的invoke()方法中调用RpcContext.setAttachment()方法,“application”为key, application name为value封装在RpcContext的扩展字段attachments中,如下:
.setAttachment(Constants.APPLICATION_KEY, invoker.getUrl().getParameter("application"))
4)服务提供方Provider从RpcContext取出application name即可
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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