java-my-life opened a new issue, #15254:
URL: https://github.com/apache/dubbo/issues/15254

   ### Pre-check
   
   - [x] I am sure that all the content I provide is in English.
   
   
   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) and found no 
similar feature requirement.
   
   
   ### Apache Dubbo Component
   
   Java SDK (apache/dubbo)
   
   ### Descriptions
   
   **Environment**
   
   - Dubbo version: 3.3.1
   - Operating System version: windows 11
   - Java version: 17
   
   
   Dubbo 3 之后推荐将reference定义和注入分开, 在一个Java 
Config类中定义reference,在引用的类中通过@Autowired来注入接口代理类。
   ```
   @Configuration
   class ConsumerConfig {
       @Bean
       @DubboReference(timeout = 50000)
       public ReferenceBean<RoleAuthorizationService> roleAuthorizationService 
(){
             return new ReferenceBean();
       }
   }
   ```
   但是这种方式只能一个一个配置定义reference,如何在项目初始化时一次性完成全部的reference定义?
   
目前项目中可以通过自定义注解的方式找到全部的reference类,但是在SpringCloud与Dubbo集成中没有找到如何通过代码的方式将所有reference类定义好,然后通过@Autowired来注入。
   ```
   class FooController {
   
       @Autowired
       private RoleAuthorizationService roleAuthorizationService;
      
      ...
   }
   ```
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a pull request to fix on your own?
   
   - [ ] Yes I am willing to submit a pull request on my own!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to