applicationContext-service.xml 1.7 KB

123456789101112131415161718192021222324
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p"
  4. xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
  5. xmlns:dubbo="http://code.alibabatech.com/schema/dubbo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  6. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
  7. http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd
  8. http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.2.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.2.xsd
  9. http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd
  10. http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.2.xsd">
  11. <context:component-scan base-package="com.itheima.service"/>
  12. <!-- 使用Dubbo发布服务 -->
  13. <!-- 提供方应用信息,用于计算依赖关系 -->
  14. <dubbo:application name="taotao-sso-service2" />
  15. <dubbo:registry protocol="zookeeper" address="192.168.37.161:2181" />
  16. <!-- 用dubbo协议在20880端口(端口可以随便写,但默认是20880)暴露服务 -->
  17. <dubbo:protocol name="dubbo" port="20885" />
  18. <!-- 声明需要暴露的服务接口 -->
  19. <dubbo:service interface="com.itheima.service.UserRegisterService" ref="userRegisterServiceImpl" timeout="300000" />
  20. <dubbo:service interface="com.itheima.service.UserLoginService" ref="userLoginServiceImpl" timeout="300000" />
  21. </beans>