springboot1.x+dubbo案例

pom文件

<dependencies>
        <dependency>
            <groupId>com.sbdubbo</groupId>
            <artifactId>provider-interface</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>io.dubbo.springboot</groupId>
            <artifactId>spring-boot-starter-dubbo</artifactId>
            <version>1.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.zookeeper</groupId>
            <artifactId>zookeeper</artifactId>
            <version>3.4.7</version>
        </dependency>
        <dependency>
            <groupId>com.github.sgroschupf</groupId>
            <artifactId>zkclient</artifactId>
            <version>0.1</version>
        </dependency>
    </dependencies>
View Code

provider

## Dubbo 服务提供者配置
spring.dubbo.application.name=provider
spring.dubbo.registry.address=zookeeper://192.168.25.128:2181
spring.dubbo.protocol.name=dubbo
spring.dubbo.protocol.port=20881
#spring.dubbo.scan=org.spring.springboot.dubbo
spring.dubbo.scan=com.sbdubbo.provider.Service
View Code

consumer

spring.dubbo.application.name=consumer
spring.dubbo.registry.address=zookeeper://192.168.25.128:2181
spring.dubbo.scan=com.sbdubbo.consumer.Service
View Code

 

posted @ 2019-05-29 11:27  一天到晚想名字  阅读(449)  评论(0编辑  收藏  举报