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/09/20 07:00:25 UTC

[GitHub] cvictory edited a comment on issue #2301: [BUG] @Reference#parameters() does not work

cvictory edited a comment on issue #2301: [BUG] @Reference#parameters() does not work
URL: https://github.com/apache/incubator-dubbo/issues/2301#issuecomment-423063355
 
 
   I write a demo to check this issue, but I found ReferenceBean has this parameter.
   
   modify dubbo configuration file :   
   ```
       <dubbo:annotation/>
       <context:component-scan base-package="com.alibaba.dubbo.demo.consumer">
           <context:include-filter type="annotation" expression="com.alibaba.dubbo.config.annotation.Reference"/>
       </context:component-scan>
   ```
   
   write service:  
   ```
   @Service
   public class ConsumerService {
   
       @Reference(parameters = {"k1", "v1"})
       private DemoService demoService;
   
       public void testReference() {
           System.out.println(demoService.sayHello("www.world"));
       }
   }
   ```
   
   And debug the referenceConfig, I found the parameter contain this key as follow:  
   
   I write a demo to check this issue, but I found ReferenceBean has this parameter.
   
   modify dubbo configuration file :   
   ```
       <dubbo:annotation/>
       <context:component-scan base-package="com.alibaba.dubbo.demo.consumer">
           <context:include-filter type="annotation" expression="com.alibaba.dubbo.config.annotation.Reference"/>
       </context:component-scan>
   ```
   
   write service:  
   ```
   @Service
   public class ConsumerService {
   
       @Reference(parameters = {"k1", "v1"})
       private DemoService demoService;
   
       public void testReference() {
           System.out.println(demoService.sayHello("www.world"));
       }
   }
   ```
   
   And debug the referenceConfig, I found the parameter contain this key as follow:  
   
   I write a demo to check this issue, but I found ReferenceBean has this parameter.
   
   modify dubbo configuration file :   
   ```
       <dubbo:annotation/>
       <context:component-scan base-package="com.alibaba.dubbo.demo.consumer">
           <context:include-filter type="annotation" expression="com.alibaba.dubbo.config.annotation.Reference"/>
       </context:component-scan>
   ```
   
   write service:  
   ```
   @Service
   public class ConsumerService {
   
       @Reference(parameters = {"k1", "v1"})
       private DemoService demoService;
   
       public void testReference() {
           System.out.println(demoService.sayHello("www.world"));
       }
   }
   ```
   
   And debug the referenceConfig, I found the parameter contain this key as follow:  
   
   
   ![2](https://user-images.githubusercontent.com/4089452/45801237-df9de600-bce5-11e8-8e20-02caea1705f6.png)
   
   
   
   
   
   
   
   
   

----------------------------------------------------------------
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