spring boot 启动脚本
启动的时候 在 boot_class 中有个:com.sankuai.qcs.regulation.shanghai.App 这是spring boot的配置,在 bin/run_main.sh中 有配置:
${EXEC_JAVA} ${boot_class} 2>&1
这样在启动的时候就会走:方法:
com.sankuai.qcs.regulation.shanghai.App;
里面的main方法; 在main里面有个:
classpath:application.xml; 在application.xml中有个:添加了注解的标签:
<task:annotation-driven/> 所以开始使用注解初始化:
com.sankuai.qcs.regulation.shanghai.service.impl;里面的方法:
@PostConstruct
private void start() {
try {
Properties successTopicProps = new Properties();
successTopicProps.setProperty(ConsumerConstants.MafkaBGNamespace, "waimai");
successTopicProps.setProperty(ConsumerConstants.MafkaClientAppkey, "com.sankuai.qcs.data.integration");
callBackProducer = MafkaClient.buildProduceFactory(successTopicProps, "dache.regulation.traffic.data"); Timer timer = new Timer();
timer.scheduleAtFixedRate(new TimerTask() {
@Override
public void run() {
batchSendTask();
}
}, , );
} catch (Throwable throwable) {
LOGGER.error("BatchSendService#start init mafka producer error", throwable);
}
}
请注意前面有个:
@PostConstruct 它的意思是在加载bean的时候就开始 先执行方法:
start 然后在pom.xml中有个:
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<finalName>qcs.service.regulation</finalName>
<classesDirectory>target/classes/</classesDirectory>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
<manifest>
<mainClass>com.sankuai.qcs.regulation.shanghai.App</mainClass>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
</archive>
</configuration>
</plugin>
里面的mainClass指的是:这个插件在在打包的时候要调用mainClass;
spring boot 启动脚本的更多相关文章
- 启动/关闭Spring boot服务脚本
启动Spring boot服务脚本 #!/bin/bash cd /test java -jar test.jar &> ./test.log & echo "成功&q ...
- Spring Boot启动流程分析
引言 早在15年的时候就开始用spring boot进行开发了,然而一直就只是用用,并没有深入去了解spring boot是以什么原理怎样工作的,说来也惭愧.今天让我们从spring boot启动开始 ...
- Spring Boot -- 启动彩蛋
使用Spring Boot启动的jar包总是会显示一个Spring的图标: . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\_ ...
- Spring Boot 启动原理分析
https://yq.aliyun.com/articles/6056 转 在spring boot里,很吸引人的一个特性是可以直接把应用打包成为一个jar/war,然后这个jar/war是可以直接启 ...
- Spring Boot启动过程(四):Spring Boot内嵌Tomcat启动
之前在Spring Boot启动过程(二)提到过createEmbeddedServletContainer创建了内嵌的Servlet容器,我用的是默认的Tomcat. private void cr ...
- Spring Boot启动过程(七):Connector初始化
Connector实例的创建已经在Spring Boot启动过程(四):Spring Boot内嵌Tomcat启动中提到了: Connector是LifecycleMBeanBase的子类,先是设置L ...
- spring boot 启动问题
spring boot启动报错误 Thread-2] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.co ...
- Spring Boot 启动(四) EnvironmentPostProcessor
Spring Boot 启动(四) EnvironmentPostProcessor Spring 系列目录(https://www.cnblogs.com/binarylei/p/10198698. ...
- Spring Boot 启动(二) 配置详解
Spring Boot 启动(二) 配置详解 Spring 系列目录(https://www.cnblogs.com/binarylei/p/10198698.html) Spring Boot 配置 ...
随机推荐
- springboot RestTemplate请求
每天学习一点点 编程PDF电子书.视频教程免费下载:http://www.shitanlife.com/code 1.定义 RestTemplateConfig 配置类 @Configuratio ...
- 微信硬件平台(一) 公众号 ESP8266 Arduino LED
微信硬件平台 本文目的,使用微信公众号控制ESP8266的LED开和关.进一步使用微信当遥控器(避免写APP或者IOS或者小程序),控制一切设备.给两个关键的总教程参考. 官网教程 微信硬件平台 微 ...
- (1) 安卓导入mqtt包基本通信
参考资料:http://blog.csdn.net/qq_17250009/article/details/52774472 MQTT官网:http://mqtt.org/ MQTT介绍:http:/ ...
- layui之日期和时间组件
参考文档:https://www.layui.com/doc/modules/laydate.html代码片段如下: layui.use('laydate', function(){ var layd ...
- Windows解压安装mysql 5.7.24,并部署多个mysql服务
mysql官网windows安装文档 https://dev.mysql.com/doc/refman/5.7/en/windows-installation.html 第一步,选择安装包 htt ...
- 初学Python——文件操作
一.文件的打开和关闭 1.常用的打开关闭语句 f=open("yesterday","r",encoding="utf-8") #打开文件 ...
- Eclipse下关于The serializable class UsersServlet does not declare a static final serialVersionUID field of type的警告
The serializable class XXX does not declare a static final serialVersionUID field of type long seria ...
- markdown的使用语法的补充
markdown的使用语法的补充 markdown的语法在网络上有很多,例如简书的教程这个是参考简书上的教程 但是有几个语法需要记住. 添加图片,如果要添加图片,他的语法格式是首先一个感叹号!然后[] ...
- 01-vue学习篇-以优雅的姿势创建vue项目
前言 小白一枚,今年(2019)准备学习一下前端的技术,因为发现自己对后端(python)相对比较熟悉但是还是写不出一个优雅的系统,可见前端的重要性,于是静下心来跟大佬学习.在不断的激励自己调整自己的 ...
- FIFO队列算法的C程序实现
头文件:Queue.h #ifndef _Queue_H #define _Queue_H typedef struct QueueDef_ //队列对象定义 { u16 front; //队列头部 ...