1) Configure "consumer.xml" file:  "consumer.xml" already defines the 
application name attribute like this:
<dubbo:application name="demo-provider"/>
2) RpcContext: There is an field "attachments" in the "RpcContext.java" to 
support the developer to extend the field values in the form of a key-value.
3) in the ComsumerContextFilter, we use the invoke() method to call the 
RpcContext.setAttachment() method as follows:
RpcContext.setAttachment(Constants.APPLICATION_KEY,invoker.getUrl().getParameter("application"))
4) The Provider can take the application name from the RpcContext:
RpcContext.getContext().getAttachment("application name")

[ Full content available at: 
https://github.com/apache/incubator-dubbo/issues/1054 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to