Simple Monitor

Dubbo simple monitor service
  1. export a simple monitor service to the registry: (If you use the installer, you don’t need to write this configuration yourself. if you implement the monitor service yourself,need it)

    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:dubbo="http://dubbo.apache.org/schema/dubbo"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd http://dubbo.apache.org/schema/dubbo http://dubbo.apache.org/schema/dubbo/dubbo.xsd">
        
    <!-- configuration of current application -->
    <dubbo:application name="simple-monitor" />
        
    <!-- connection address of the registry -->
    <dubbo:registry address="127.0.0.1:9090" />
        
    <!-- protool configuration of exposed services -->
    <dubbo:protocol port="7070" />
        
    <!-- configuration of certain exposed service -->
    <dubbo:service interface="org.apache.dubbo.monitor.MonitorService" ref="monitorService" />
        
    <bean id="monitorService" class="org.apache.dubbo.monitor.simple.SimpleMonitorService" />
    </beans>
    
  2. Discovery the monitor service int the registry:

    <dubbo:monitor protocol="registry" />
    

    or

    dubbo.properties

    dubbo.monitor.protocol=registry
    
  3. Export a simple monitor service ,but don’t register it to th registry: (If you use the installer, you don’t need to write this configuration yourself. if you implement the monitor service yourself,need it)

    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:dubbo="http://dubbo.apache.org/schema/dubbo"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd http://dubbo.apache.org/schema/dubbo http://dubbo.apache.org/schema/dubbo/dubbo.xsd">
        
    <!-- configuration of current application -->
    <dubbo:application name="simple-monitor" />
        
    <!-- protool configuration of exposed service -->
    <dubbo:protocol port="7070" />
        
    <!-- configuration of exposed service -->
    <dubbo:service interface="org.apache.dubbo.monitor.MonitorService" ref="monitorService" registry="N/A" />
        
    <bean id="monitorService" class="org.apache.dubbo.monitor.simple.SimpleMonitorService" />   
    </beans>
    
  4. connected to the monitor service straightly

    <dubbo:monitor address="dubbo://127.0.0.1:7070/org.apache.dubbo.monitor.MonitorService" />
    

    or:

    <dubbo:monitor address="127.0.0.1:7070" />
    

    or:

    dubbo.properties

    dubbo.monitor.address=127.0.0.1:7070
    

Last modified November 25, 2020: fix sample code issue for SPI.md (#659) (0576d68)