zoukankan      html  css  js  c++  java
  • dubbo学习(二)配置dubbo XML方式配置

    provider(生产者)

    <beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:dubbo="http://dubbo.apache.org/schema/dubbo"
           xmlns="http://www.springframework.org/schema/beans"
           xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
           http://dubbo.apache.org/schema/dubbo http://dubbo.apache.org/schema/dubbo/dubbo.xsd">
        <!--配置应用名-->
        <dubbo:application name="demo-provider"/>
        <!--配置注册中心-->
        <dubbo:registry address="zookeeper://127.0.0.1:2181"/>
        <!--配置服务协议-->
        <dubbo:protocol name="dubbo" port="20890"/>
        <!--配置服务暴露-->
        <bean id="demoService" class="org.apache.dubbo.samples.basic.impl.DemoServiceImpl"/>
        <dubbo:service interface="org.apache.dubbo.samples.basic.api.DemoService" ref="demoService"/>
    </beans>

    consumer(消费者)

    <beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:dubbo="http://dubbo.apache.org/schema/dubbo"
           xmlns="http://www.springframework.org/schema/beans"
           xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
           http://dubbo.apache.org/schema/dubbo http://dubbo.apache.org/schema/dubbo/dubbo.xsd">
        <!--配置应用名-->
        <dubbo:application name="demo-consumer"/>
        <!--配置注册中心-->
        <dubbo:registry group="aaa" address="zookeeper://127.0.0.1:2181"/>
        <!--配置代理-->
        <dubbo:reference id="demoService" check="false" interface="org.apache.dubbo.samples.basic.api.DemoService"/>
    </beans>

    monitor(监视器)

    <!--配置监控器:通过注册中心获取monitor地址后建立链接-->
    <dubbo:monitor protocal="registry"/>
    <!--配置监控器:绕过注册中心,直连monitor-->
    <dubbo:monitor address="dubbo://127.0.0.1:7070/xxxMonitorService"/>

    常用标签

  • 相关阅读:
    find指令使用手册
    IP封包协议头/TCP协议头/TCP3次握手/TCP4次挥手/UDP协议头/ICMP协议头/HTTP协议(请求报文和响应报文)/IP地址/子网掩码(划分子网)/路由概念/MAC封包格式
    Vmare虚拟机中的3种网络连接方式
    Windows10下Apache2.4配置Django
    网站配色
    js 图片轮播
    Window10下Apache2.4的安装和运行
    sqlite数据库转换为mysql数据库
    windows10 安装 mysql 5.6 教程
    win10 nginx + django +flup 配置
  • 原文地址:https://www.cnblogs.com/riches/p/11193499.html
Copyright © 2011-2022 走看看