demoralizerr commented on issue #15814:
URL: https://github.com/apache/dubbo/issues/15814#issuecomment-3796974066

   @java-my-life 
   To use @ConditionalOnMissingBean effectively in this scenario, you should 
move the bean definition logic into a @Configuration class.
   
   The reason your current code is unreliable is that Spring's Component 
Scanning (which processes @DubboService or @Service on classes) does not 
guarantee the order in which classes are loaded. If Spring scans 
TestServiceImpl before TestServiceExtImpl, the "missing bean" condition will 
pass because the extension bean hasn't been registered yet, resulting in both 
beans being created.


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