kylixs commented on a change in pull request #8455:
URL: https://github.com/apache/dubbo/pull/8455#discussion_r686613214



##########
File path: 
dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ReferenceConfig.java
##########
@@ -247,26 +238,69 @@ protected synchronized void init() {
             this.refresh();
         }
 
-        //init serivceMetadata
+        //init serviceMetadata
         initServiceMetadata(consumer);
         serviceMetadata.setServiceType(getServiceInterfaceClass());
         // TODO, uncomment this line once service key is unified
         serviceMetadata.setServiceKey(URL.buildKey(interfaceName, group, 
version));
 
+        Map<String, String> referenceParameters = appendConfig();
+
+        serviceMetadata.getAttachments().putAll(referenceParameters);
+
+        ref = createProxy(referenceParameters);
+
+        serviceMetadata.setTarget(ref);
+        serviceMetadata.addAttribute(PROXY_CLASS_REF, ref);
+
         ServiceRepository repository = ApplicationModel.getServiceRepository();
         ServiceDescriptor serviceDescriptor = 
repository.registerService(interfaceClass);
         repository.registerConsumer(

Review comment:
       It seems that consumer model may be fetched in creating proxy 
processing. 
   ```java
   ```
       public InvokerInvocationHandler(Invoker<?> handler) {
           this.invoker = handler;
           this.url = invoker.getUrl();
           String serviceKey = this.url.getServiceKey();
           this.protocolServiceKey = this.url.getProtocolServiceKey();
           if (serviceKey != null) {
               this.consumerModel = 
ApplicationModel.getConsumerModel(serviceKey);
           }
       }
   ```
   
![image](https://user-images.githubusercontent.com/5483385/128995823-747170b8-8687-4a4a-854c-75be07b5f7c8.png)
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org
For additional commands, e-mail: notifications-h...@dubbo.apache.org

Reply via email to