Giter Site home page Giter Site logo

spring-boot-starter-dubbo's Introduction

项目介绍

Dubbo项目的SpringBoot自动配置module项目, 会提供一个CommandLineRunner来帮助latch当前dubbo服务端进程的退出。

使用说明

在要开发的基于dubbo和springboot的微服务项目的pom.xml中追加如下依赖配置:

        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>dubbo</artifactId>
            <version>2.5.3</version>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.wacai</groupId>
            <artifactId>spring-boot-starter-dubbo</artifactId>
            <version>1.0.2</version>
        </dependency>

然后, 在SpringBootApplication启动类中加载dubbo相关的spring xml配置即可:

@SpringBootApplication
public class DubboWithSpringbootApplication {
    /**
     * SpringApplication的构造参数中, 标注了@SpringBootApplication的Main入口类是必须的;
     * 后面的参数一般传入dubbo服务的bean定义所在的配置文件路径,比如"classpath*:/spring/*.xml"
     * 之后,直接运行即可;(当然也可以设置一些参数,比如禁止banner打印等)
     */
    public static void main(String[] args) {
        SpringApplication application = new SpringApplication(DubboWithSpringbootApplication.class, "classpath*:/spring/**/*.xml");
        application.run(args);
    }
}

就这些~

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.