zoukankan      html  css  js  c++  java
  • dubbo

    provider

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
        xsi:schemaLocation="http://www.springframework.org/schema/beans 
        http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
        http://code.alibabatech.com/schema/dubbo 
        http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
    <!-- 1,配置应用名称 -->
    <dubbo:application name="jt-dubbo-cart"/>
    <!-- 2,配置zookeeper的ip地址和端口号 -->
    <dubbo:registry timeout="9000000" address="zookeeper://192.168.132.140:2181"></dubbo:registry>
    <!-- 3,设置端口号,消费者通过网络访问这个提供者 -->
    <dubbo:protocol port="20886" name="dubbo"></dubbo:protocol>
    <!-- 4,配置实现类,创建对象 -->
    <bean class="com.jt.cart.service.CartServiceImpl" id="cartServiceImpl"></bean>
    <!-- 5, 公开对象,公开后,消费者只能通过网络访问-->
    <dubbo:service  interface="com.jt.cart.service.CartService" ref="cartServiceImpl">
    </dubbo:service>
    </beans>

    consumer

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
        xsi:schemaLocation="http://www.springframework.org/schema/beans 
        http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
        http://code.alibabatech.com/schema/dubbo 
        http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
        <!-- 1, 配置应用名称 -->
        <dubbo:application name="jt-dubbo-cart" />
        <!-- 2, 配置zookeeper -->
        <dubbo:registry timeout="900000"
            address="zookeeper://192.168.132.140:2181"></dubbo:registry>
        <!-- 3,配置接口 -->
        <!-- spring LoginController 调LoginService,从spring框架有@service LoginServiceImpl 
            @autowired LoginService @autowired CartService 加了refrence标签,@autowired CartService 
            spring调dubbo框架,dubbo框架从zookeeper找到实现类 -->
        <dubbo:reference timeout="50000" check="false"
            id="cartServiceImpl" interface="com.jt.cart.service.CartService"></dubbo:reference>
    
        <dubbo:reference timeout="50000" check="false" id="orderService"
            interface="com.jt.order.service.OrderService"></dubbo:reference>
            
            
        <dubbo:reference timeout="50000" check="false" id="searchServiceervice"
            interface="com.jt.search.service.SearchService"></dubbo:reference>
            
            
    </beans>
  • 相关阅读:
    Swift实现单例
    UIViewContentMode说明
    打开或关闭Mac的隐藏文件的命令。
    struts2-2.3.20以上版本无法正常启动
    eclipse下导入jdk源码
    js 与css script
    eclipse导入jquery包后报错
    ${pageContext.request.contextPath} :JSP取得绝对路径方法
    小米暑期实习在线笔试2015-04-25
    android动态污点分析
  • 原文地址:https://www.cnblogs.com/gxlaqj/p/11758463.html
Copyright © 2011-2022 走看看