wzhangNJ commented on issue #4157:
URL: https://github.com/apache/shenyu/issues/4157#issuecomment-1304991463

   alibba dubbo
   ```
   public void onApplicationEvent(@NonNull final ContextRefreshedEvent 
contextRefreshedEvent) {
           if (!registered.compareAndSet(false, true)) {
               return;
           }
           // Fix bug(https://github.com/apache/shenyu/issues/415), upload 
dubbo metadata on ContextRefreshedEvent
           Map<String, ServiceBean> serviceBean = 
contextRefreshedEvent.getApplicationContext().getBeansOfType(ServiceBean.class);
           for (Map.Entry<String, ServiceBean> entry : serviceBean.entrySet()) {
               handler(entry.getValue());
           }
           serviceBean.values()
                   .stream()
                   .findFirst()
                   .ifPresent(bean -> 
publisher.publishEvent(buildURIRegisterDTO(bean)));
       }
   ```
   apache dubbo
   ```
   public void onApplicationEvent(final ContextRefreshedEvent 
contextRefreshedEvent) {
           // Fix bug(https://github.com/apache/shenyu/issues/415), upload 
dubbo metadata on ContextRefreshedEvent
           Map<String, ServiceBean> serviceBean = 
contextRefreshedEvent.getApplicationContext().getBeansOfType(ServiceBean.class);
           if (serviceBean.isEmpty()) {
               return;
           }
           if (!registered.compareAndSet(false, true)) {
               return;
           }
           for (Map.Entry<String, ServiceBean> entry : serviceBean.entrySet()) {
               handler(entry.getValue());
           }
           serviceBean.values().stream().findFirst().ifPresent(bean -> {
               publisher.publishEvent(buildURIRegisterDTO(bean));
           });
       }
   ```


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

Reply via email to