dubbo icon indicating copy to clipboard operation
dubbo copied to clipboard

Dubbo3.1 找不到ServiceBeanExportedEvent的监听器

Open conghuhu opened this issue 2 years ago • 4 comments

  • [x] I have searched the issues of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: 3.1.0-SNAPSHOT
  • Operating System version: windows11
  • Java version: 11

Steps to reproduce this issue

  1. org.apache.dubbo.config.spring.ServiceBean#publishExportEvent()代码如下:
    private void publishExportEvent() {
        ServiceBeanExportedEvent exportEvent = new ServiceBeanExportedEvent(this);
        applicationEventPublisher.publishEvent(exportEvent);
    }

但我在3.1分支中并没有找到ServiceBeanExportedEvent的监听器

  1. 与之类似的,org.apache.dubbo.config.ServiceListener并未找到其有效的实现类,继承者而在ServiceConfig中init()方法如下使用:
    public void init() {
        if (this.initialized.compareAndSet(false, true)) {
            // load ServiceListeners from extension
            ExtensionLoader<ServiceListener> extensionLoader = this.getExtensionLoader(ServiceListener.class);
            this.serviceListeners.addAll(extensionLoader.getSupportedExtensionInstances());
        }
        initServiceMetadata(provider);
        serviceMetadata.setServiceType(getInterfaceClass());
        serviceMetadata.setTarget(getRef());
        serviceMetadata.generateServiceKey();
    }

debug查看发现serviceListeners为空

那这两处是否为升级过程中的代码冗余?

conghuhu avatar Jul 23 '22 12:07 conghuhu

这两处是Dubbo对外提供的监听功能,设计给业务自定义扩展使用的

AlbumenJ avatar Jul 27 '22 08:07 AlbumenJ

font{
    line-height: 1.6;
}
ul,ol{
    padding-left: 20px;
    list-style-position: inside;
}



是这样子,好的
    

    
        
    


 

    
                ***@***.***
    




---- 回复的原邮件 ----



  
    
     发件人 
    
    
        Albumen ***@***.***>
        
    
  
  
    
     发送日期 
    
    
    2022年7月27日 16:57
    
  
  
    
     收件人 
    
    
     
      
        ***@***.***>
        
      
    
  
  
    
     抄送人 
    
    
      
        ***@***.***>
        ,
      
      
        ***@***.***>
        
      
    
  
  
    
     主题 
    
    
          Re: [apache/dubbo] Dubbo3.1 找不到ServiceBeanExportedEvent的监听器 (Issue #10358)
    
  

这两处是Dubbo对外提供的监听功能,设计给业务自定义扩展使用的

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

conghuhu avatar Jul 27 '22 08:07 conghuhu

Dubbo3.1发版本了吗,咋就用上了;怎么引用呢,编译源码吗

simonally avatar Aug 01 '22 06:08 simonally

目前 3.1.0-SNAPSHOT 已经发布到 apache repository 的 snapshot 仓库,正式版本月中发布

AlbumenJ avatar Aug 01 '22 06:08 AlbumenJ