springboot与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/
浙公网安备 33010602011771号