[dev] samples change to use powerjob-spring-boot-starter & change pom version to 3.2.2

This commit is contained in:
朱八 2020-08-01 21:45:45 +08:00
parent 105c8b5baf
commit 555a20bc7f
10 changed files with 32 additions and 29 deletions

View File

@ -9,7 +9,7 @@
<version>2.0.0</version> <version>2.0.0</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>powerjob</name> <name>powerjob</name>
<url>https://github.com/KFCFans/PowerJob</url> <url>http://www.powerjob.tech</url>
<description>Distributed scheduling and execution framework</description> <description>Distributed scheduling and execution framework</description>
<licenses> <licenses>
<license> <license>

View File

@ -10,11 +10,11 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>powerjob-client</artifactId> <artifactId>powerjob-client</artifactId>
<version>3.2.1</version> <version>3.2.2</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<properties> <properties>
<powerjob.common.version>3.2.1</powerjob.common.version> <powerjob.common.version>3.2.2</powerjob.common.version>
<junit.version>5.6.1</junit.version> <junit.version>5.6.1</junit.version>
</properties> </properties>

View File

@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>powerjob-common</artifactId> <artifactId>powerjob-common</artifactId>
<version>3.2.1</version> <version>3.2.2</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<properties> <properties>

View File

@ -10,13 +10,13 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>powerjob-server</artifactId> <artifactId>powerjob-server</artifactId>
<version>3.2.1</version> <version>3.2.2</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<properties> <properties>
<swagger.version>2.9.2</swagger.version> <swagger.version>2.9.2</swagger.version>
<springboot.version>2.2.6.RELEASE</springboot.version> <springboot.version>2.2.6.RELEASE</springboot.version>
<powerjob.common.version>3.2.1</powerjob.common.version> <powerjob.common.version>3.2.2</powerjob.common.version>
<!-- 数据库驱动版本使用的是spring-boot-dependencies管理的版本 --> <!-- 数据库驱动版本使用的是spring-boot-dependencies管理的版本 -->
<mysql.version>8.0.19</mysql.version> <mysql.version>8.0.19</mysql.version>
<ojdbc.version>19.7.0.0</ojdbc.version> <ojdbc.version>19.7.0.0</ojdbc.version>

View File

@ -10,12 +10,12 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>powerjob-worker-agent</artifactId> <artifactId>powerjob-worker-agent</artifactId>
<version>3.2.1</version> <version>3.2.2</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<properties> <properties>
<powerjob.worker.version>3.2.1</powerjob.worker.version> <powerjob.worker.version>3.2.2</powerjob.worker.version>
<logback.version>1.2.3</logback.version> <logback.version>1.2.3</logback.version>
<picocli.version>4.3.2</picocli.version> <picocli.version>4.3.2</picocli.version>

View File

@ -10,11 +10,11 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>powerjob-worker-samples</artifactId> <artifactId>powerjob-worker-samples</artifactId>
<version>3.2.1</version> <version>3.2.2</version>
<properties> <properties>
<springboot.version>2.2.6.RELEASE</springboot.version> <springboot.version>2.2.6.RELEASE</springboot.version>
<powerjob.worker.version>3.2.1</powerjob.worker.version> <powerjob.worker.starter.version>3.2.2</powerjob.worker.starter.version>
<fastjson.version>1.2.68</fastjson.version> <fastjson.version>1.2.68</fastjson.version>
<!-- 部署时跳过该module --> <!-- 部署时跳过该module -->
@ -43,8 +43,8 @@
<dependency> <dependency>
<groupId>com.github.kfcfans</groupId> <groupId>com.github.kfcfans</groupId>
<artifactId>powerjob-worker</artifactId> <artifactId>powerjob-worker-spring-boot-starter</artifactId>
<version>${powerjob.worker.version}</version> <version>${powerjob.worker.starter.version}</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson --> <!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
<dependency> <dependency>

View File

@ -1,17 +1,10 @@
package com.github.kfcfans.powerjob.samples; package com.github.kfcfans.powerjob.samples;
import com.github.kfcfans.powerjob.worker.OhMyWorker;
import com.github.kfcfans.powerjob.worker.common.OhMyConfig;
import com.github.kfcfans.powerjob.worker.common.constants.StoreStrategy;
import com.google.common.collect.Lists;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import java.util.List;
/** /**
* OMS-Worker 配置 * powerjob-worker 配置
* 代码配置示例SpringBoot 项目支持使用 starter只需要在 application.properties 中完成配置即可
* *
* @author tjq * @author tjq
* @since 2020/4/17 * @since 2020/4/17
@ -19,8 +12,7 @@ import java.util.List;
@Configuration @Configuration
public class OhMySchedulerConfig { public class OhMySchedulerConfig {
@Value("${powerjob.akka.port}") /*
private int port;
@Bean @Bean
public OhMyWorker initOMS() throws Exception { public OhMyWorker initOMS() throws Exception {
@ -30,7 +22,7 @@ public class OhMySchedulerConfig {
// 1. 创建配置文件 // 1. 创建配置文件
OhMyConfig config = new OhMyConfig(); OhMyConfig config = new OhMyConfig();
config.setPort(port); config.setPort(27777);
config.setAppName("powerjob-agent-test"); config.setAppName("powerjob-agent-test");
config.setServerAddress(serverAddress); config.setServerAddress(serverAddress);
// 如果没有大型 Map/MapReduce 的需求建议使用内存来加速计算 // 如果没有大型 Map/MapReduce 的需求建议使用内存来加速计算
@ -40,5 +32,8 @@ public class OhMySchedulerConfig {
OhMyWorker ohMyWorker = new OhMyWorker(); OhMyWorker ohMyWorker = new OhMyWorker();
ohMyWorker.setConfig(config); ohMyWorker.setConfig(config);
return ohMyWorker; return ohMyWorker;
} }
*/
} }

View File

@ -2,4 +2,12 @@ server.port=8081
spring.jpa.open-in-view=false spring.jpa.open-in-view=false
powerjob.akka.port=27777 ########### powerjob-worker 配置 ###########
# akka 工作端口,可选,默认 27777
powerjob.akka-port=27777
# 接入应用名称,用于分组隔离,推荐填写 本 Java 项目名称
powerjob.app-name=powerjob-agent-test
# 调度服务器地址IP:Port 或 域名,多值逗号分隔
powerjob.server-address=127.0.0.1:7700,127.0.0.1:7701
# 持久化方式,可选,默认 disk
powerjob.store-strategy=disk

View File

@ -10,11 +10,11 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>powerjob-worker-spring-boot-starter</artifactId> <artifactId>powerjob-worker-spring-boot-starter</artifactId>
<version>3.2.1</version> <version>3.2.2</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<properties> <properties>
<powerjob.worker.version>3.2.1</powerjob.worker.version> <powerjob.worker.version>3.2.2</powerjob.worker.version>
<springboot.version>2.2.6.RELEASE</springboot.version> <springboot.version>2.2.6.RELEASE</springboot.version>
</properties> </properties>

View File

@ -10,12 +10,12 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>powerjob-worker</artifactId> <artifactId>powerjob-worker</artifactId>
<version>3.2.1</version> <version>3.2.2</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<properties> <properties>
<spring.version>5.2.4.RELEASE</spring.version> <spring.version>5.2.4.RELEASE</spring.version>
<powerjob.common.version>3.2.1</powerjob.common.version> <powerjob.common.version>3.2.2</powerjob.common.version>
<h2.db.version>1.4.200</h2.db.version> <h2.db.version>1.4.200</h2.db.version>
<hikaricp.version>3.4.2</hikaricp.version> <hikaricp.version>3.4.2</hikaricp.version>
<junit.version>5.6.1</junit.version> <junit.version>5.6.1</junit.version>