parent
aa7e5e5648
commit
a83c21a43a
@ -0,0 +1,13 @@
|
||||
package com.xxl.job.executor;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(Application.class, args);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package com.xxl.job.executor.core.config;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.ImportResource;
|
||||
|
||||
|
||||
@Configuration
|
||||
@ImportResource("classpath:applicationcontext-xxl-job.xml")
|
||||
public class XxlJobConfig {
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.xxl.job.executor.mvc.handler;
|
||||
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
@Controller
|
||||
@EnableAutoConfiguration
|
||||
public class IndexController {
|
||||
|
||||
@RequestMapping("/")
|
||||
@ResponseBody
|
||||
String index() {
|
||||
return "xxl job running.";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1 @@
|
||||
server.port=8081
|
@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE log4j:configuration PUBLIC "-//log4j/log4j Configuration//EN" "log4j.dtd">
|
||||
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" threshold="null" debug="null">
|
||||
|
||||
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
|
||||
<param name="Target" value="System.out" />
|
||||
<layout class="org.apache.log4j.PatternLayout">
|
||||
<param name="ConversionPattern" value="%-d{yyyy-MM-dd HH:mm:ss} xxl-job-executor-springboot-example [%c]-[%t]-[%M]-[%L]-[%p] %m%n"/>
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender">
|
||||
<param name="file" value="/data/applogs/xxl-job/xxl-job-executor-springboot-example.log"/>
|
||||
<param name="append" value="true"/>
|
||||
<param name="encoding" value="UTF-8"/>
|
||||
<layout class="org.apache.log4j.PatternLayout">
|
||||
<param name="ConversionPattern" value="%-d{yyyy-MM-dd HH:mm:ss} xxl-job-executor-springboot-example [%c]-[%t]-[%M]-[%L]-[%p] %m%n"/>
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<appender name="xxl-job" class="com.xxl.job.core.log.XxlJobFileAppender">
|
||||
<param name="filePath" value="/data/applogs/xxl-job/jobhandler/"/>
|
||||
<!--<param name="append" value="true"/>-->
|
||||
<!--<param name="encoding" value="UTF-8"/>-->
|
||||
<layout class="org.apache.log4j.PatternLayout">
|
||||
<param name="ConversionPattern" value="%-d{yyyy-MM-dd HH:mm:ss} xxl-job-executor-springboot-example [%c]-[%t]-[%M]-[%L]-[%p] %m%n"/>
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
|
||||
<logger name="com.xxl.job.core" additivity="false">
|
||||
<level value="INFO" />
|
||||
<appender-ref ref="CONSOLE" />
|
||||
<appender-ref ref="FILE" />
|
||||
<appender-ref ref="xxl-job"/>
|
||||
</logger>
|
||||
<logger name="com.xxl.job.executor.service.jobhandler" additivity="false">
|
||||
<level value="INFO" />
|
||||
<appender-ref ref="CONSOLE" />
|
||||
<appender-ref ref="FILE" />
|
||||
<appender-ref ref="xxl-job"/>
|
||||
</logger>
|
||||
<root>
|
||||
<level value="INFO" />
|
||||
<appender-ref ref="CONSOLE" />
|
||||
<appender-ref ref="FILE" />
|
||||
<appender-ref ref="xxl-job"/>
|
||||
</root>
|
||||
|
||||
</log4j:configuration>
|
@ -0,0 +1,10 @@
|
||||
### xxl-job db
|
||||
xxl.job.db.driverClass=com.mysql.jdbc.Driver
|
||||
xxl.job.db.url=jdbc:mysql://localhost:3306/xxl-job?useUnicode=true&characterEncoding=UTF-8
|
||||
xxl.job.db.user=root
|
||||
xxl.job.db.password=root_pwd
|
||||
|
||||
### xxl-job executor address
|
||||
xxl.job.executor.appname=xxl-job-executor-example
|
||||
xxl.job.executor.ip=
|
||||
xxl.job.executor.port=9999
|
@ -0,0 +1,19 @@
|
||||
package com.xxl.job.executor.test;
|
||||
|
||||
import com.xxl.job.executor.Application;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.SpringApplicationConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.test.context.web.WebAppConfiguration;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringApplicationConfiguration(classes = Application.class)
|
||||
@WebAppConfiguration
|
||||
public class XxlJobExecutorExampleBootApplicationTests {
|
||||
|
||||
@Test
|
||||
public void contextLoads() {
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue