Repository: wacai/spring-boot-starter-dubbo
Branch: master
Commit: 33ace740696c
Files: 6
Total size: 5.3 KB
Directory structure:
gitextract_d8fc152g/
├── .gitignore
├── README.md
├── pom.xml
└── src/
└── main/
├── java/
│ └── com/
│ └── wacai/
│ └── springboot/
│ └── dubbo/
│ ├── autoconfigure/
│ │ └── DubboAutoConfiguration.java
│ └── commands/
│ └── DubboServiceLatchCommandLineRunner.java
└── resources/
└── META-INF/
└── spring.factories
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
.classpath
.project
webapp/WEB-INF/classes/
lib_managed/
project/target/*
project/project/target/*
project/build/target/*
project/boot/*
project/plugins/lib_managed/*
project/plugins/project/*
project/plugins/target/*
project/plugins/src_managed/*
target/
.idea/
.idea_modules/
*.iml
.DS_Store
out/
logs/
*.log
.settings/
================================================
FILE: README.md
================================================
# 项目介绍
Dubbo项目的SpringBoot自动配置module项目, 会提供一个CommandLineRunner来帮助latch当前dubbo服务端进程的退出。
# 使用说明
在要开发的基于dubbo和springboot的微服务项目的pom.xml中追加如下依赖配置:
~~~~~~~ {.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配置即可:
~~~~~~~ {.java}
@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);
}
}
~~~~~~~
就这些~
================================================
FILE: pom.xml
================================================
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starters</artifactId>
<version>1.2.5.RELEASE</version>
</parent>
<groupId>com.wacai</groupId>
<artifactId>spring-boot-starter-dubbo</artifactId>
<version>1.0.3-SNAPSHOT</version>
<packaging>jar</packaging>
<name>spring-boot-starter-dubbo</name>
<url>https://github.com/wacai/spring-boot-starter-dubbo</url>
<licenses>
<license>
<name>Apache License 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
</license>
</licenses>
<developers>
<developer>
<id>yunshi</id>
<name>陨石, aka.扶墙老师</name>
<email>yunshi@wacai.com</email>
<url>http://afoo.me/whoami.html</url>
<organization>wacai.com</organization>
<organizationUrl>http://www.wacai.com/</organizationUrl>
</developer>
</developers>
<scm>
<url>https://github.com/wacai/spring-boot-starter-dubbo</url>
<connection>git@github.com:wacai/spring-boot-starter-dubbo.git</connection>
</scm>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.wacai</groupId>
<artifactId>goodies</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
</project>
================================================
FILE: src/main/java/com/wacai/springboot/dubbo/autoconfigure/DubboAutoConfiguration.java
================================================
package com.wacai.springboot.dubbo.autoconfigure;
import com.wacai.springboot.dubbo.commands.DubboServiceLatchCommandLineRunner;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
@Configuration
@Order
public class DubboAutoConfiguration {
protected Logger logger = LoggerFactory.getLogger(DubboAutoConfiguration.class);
@Value("${shutdown.latch.domain.name:com.wacai.lifecycles}")
private String shutdownLatchDomainName;
@Bean
@ConditionalOnClass(name = "com.alibaba.dubbo.rpc.Exporter")
public DubboServiceLatchCommandLineRunner configureDubboServiceLatchCommandLineRunner() {
logger.debug("DubboAutoConfiguration enabled by adding DubboServiceLatchCommandLineRunner.");
DubboServiceLatchCommandLineRunner runner = new DubboServiceLatchCommandLineRunner();
runner.setDomain(shutdownLatchDomainName);
return runner;
}
}
================================================
FILE: src/main/java/com/wacai/springboot/dubbo/commands/DubboServiceLatchCommandLineRunner.java
================================================
package com.wacai.springboot.dubbo.commands;
import com.wacai.goodies.lifecycle.ShutdownLatch;
import org.springframework.boot.CommandLineRunner;
public class DubboServiceLatchCommandLineRunner implements CommandLineRunner {
private String domain = "com.wacai.lifecycles";
@Override
public void run(String... args) throws Exception {
ShutdownLatch latch = new ShutdownLatch(getDomain());
latch.await();
}
public String getDomain() {
return domain;
}
public void setDomain(String domain) {
this.domain = domain;
}
}
================================================
FILE: src/main/resources/META-INF/spring.factories
================================================
org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.wacai.springboot.dubbo.autoconfigure.DubboAutoConfiguration
gitextract_d8fc152g/
├── .gitignore
├── README.md
├── pom.xml
└── src/
└── main/
├── java/
│ └── com/
│ └── wacai/
│ └── springboot/
│ └── dubbo/
│ ├── autoconfigure/
│ │ └── DubboAutoConfiguration.java
│ └── commands/
│ └── DubboServiceLatchCommandLineRunner.java
└── resources/
└── META-INF/
└── spring.factories
SYMBOL INDEX (6 symbols across 2 files)
FILE: src/main/java/com/wacai/springboot/dubbo/autoconfigure/DubboAutoConfiguration.java
class DubboAutoConfiguration (line 13) | @Configuration
method configureDubboServiceLatchCommandLineRunner (line 22) | @Bean
FILE: src/main/java/com/wacai/springboot/dubbo/commands/DubboServiceLatchCommandLineRunner.java
class DubboServiceLatchCommandLineRunner (line 7) | public class DubboServiceLatchCommandLineRunner implements CommandLineRu...
method run (line 11) | @Override
method getDomain (line 18) | public String getDomain() {
method setDomain (line 22) | public void setDomain(String domain) {
Condensed preview — 6 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (6K chars).
[
{
"path": ".gitignore",
"chars": 322,
"preview": ".classpath\n.project\nwebapp/WEB-INF/classes/\nlib_managed/\nproject/target/*\nproject/project/target/*\nproject/build/target/"
},
{
"path": "README.md",
"chars": 1318,
"preview": "# 项目介绍\n\nDubbo项目的SpringBoot自动配置module项目, 会提供一个CommandLineRunner来帮助latch当前dubbo服务端进程的退出。\n\n# 使用说明\n\n在要开发的基于dubbo和springboot的"
},
{
"path": "pom.xml",
"chars": 1779,
"preview": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:sc"
},
{
"path": "src/main/java/com/wacai/springboot/dubbo/autoconfigure/DubboAutoConfiguration.java",
"chars": 1274,
"preview": "package com.wacai.springboot.dubbo.autoconfigure;\n\nimport com.wacai.springboot.dubbo.commands.DubboServiceLatchCommandLi"
},
{
"path": "src/main/java/com/wacai/springboot/dubbo/commands/DubboServiceLatchCommandLineRunner.java",
"chars": 587,
"preview": "package com.wacai.springboot.dubbo.commands;\n\nimport com.wacai.goodies.lifecycle.ShutdownLatch;\nimport org.springframewo"
},
{
"path": "src/main/resources/META-INF/spring.factories",
"chars": 126,
"preview": "org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.wacai.springboot.dubbo.autoconfigure.DubboAutoConfigu"
}
]
About this extraction
This page contains the full source code of the wacai/spring-boot-starter-dubbo GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 6 files (5.3 KB), approximately 1.7k tokens, and a symbol index with 6 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.