码迷,mamicode.com
首页 > 编程语言 > 详细

springboot与dubbo整合

时间:2019-06-11 11:06:25      阅读:87      评论:0      收藏:0      [点我收藏+]

标签:city   配置   toc   col   host   ack   enc   dubbo   依赖   

1.添加依赖

	<!-- Spring Boot Dubbo 依赖 -->
		<dependency>
			<groupId>io.dubbo.springboot</groupId>
			<artifactId>spring-boot-starter-dubbo</artifactId>
			<version>${dubbo-spring-boot}</version>
		</dependency>

		<!-- Spring Boot Web 依赖 -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>

		<!-- Spring Boot Test 依赖 -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>

		<!-- springboot-log4j -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-log4j</artifactId>
			<version>1.3.8.RELEASE</version>
		</dependency>

配置属性文件

application.propertise

##dubbo 配置 服务端配置
spring.dubbo.application.name=provider                    //服务提供者
spring.dubbo.registry.address=zookeeper://127.0.0.1:2181  //zk地址
spring.dubbo.protocol.name=dubbo                    //协议
spring.dubbo.protocol.port=20880                    //协议端口
spring.dubbo.scan=com.example.springboot.service   //扫包路径

 

 

 

2.下载zookeeper

启动zkServer.cmd

3.下载dubbo-admin 

application.properties 属性文件的配置

#

server.port=7001
#server.servlet.context-path=/dubbo
spring.velocity.cache=false
spring.velocity.charset=UTF-8
spring.velocity.layout-url=/templates/default.vm
spring.messages.fallback-to-system-locale=false
spring.messages.basename=i18n/message
spring.root.password=root
spring.guest.password=guest

dubbo.registry.address=zookeeper://127.0.0.1:2181

 引入idea,启动dubbo-admin

访问  http://localhost:7001/

 

springboot与dubbo整合

标签:city   配置   toc   col   host   ack   enc   dubbo   依赖   

原文地址:https://www.cnblogs.com/ptcnblog/p/11002150.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!