diff --git a/.run/ruoyi-xxl-job-admin.run.xml b/.run/ruoyi-powerjob-server.run.xml similarity index 56% rename from .run/ruoyi-xxl-job-admin.run.xml rename to .run/ruoyi-powerjob-server.run.xml index be5255766..7c42630c3 100644 --- a/.run/ruoyi-xxl-job-admin.run.xml +++ b/.run/ruoyi-powerjob-server.run.xml @@ -1,10 +1,10 @@ - + - diff --git a/ruoyi-admin/src/main/resources/application-dev.yml b/ruoyi-admin/src/main/resources/application-dev.yml index e2ca3d60d..0d895fac5 100644 --- a/ruoyi-admin/src/main/resources/application-dev.yml +++ b/ruoyi-admin/src/main/resources/application-dev.yml @@ -11,15 +11,16 @@ spring.boot.admin.client: --- # powerjob 配置 powerjob: worker: - enabled: true - # 需要现在powerjob登录页执行应用注册后才能使用 + # 如何开启调度中心请查看文档教程 + enabled: false + # 需要先在 powerjob 登录页执行应用注册后才能使用 app-name: ruoyi-worker enable-test-mode: false max-appended-wf-context-length: 4096 max-result-length: 4096 port: 27777 protocol: http - server-address: 127.0.0.1:7700,127.0.0.1:7701 + server-address: 127.0.0.1:7700 store-strategy: disk --- # 数据源配置 diff --git a/ruoyi-admin/src/main/resources/application-prod.yml b/ruoyi-admin/src/main/resources/application-prod.yml index 1928c5b93..836fc2207 100644 --- a/ruoyi-admin/src/main/resources/application-prod.yml +++ b/ruoyi-admin/src/main/resources/application-prod.yml @@ -14,15 +14,16 @@ spring.boot.admin.client: --- # powerjob 配置 powerjob: worker: - enabled: true - # 需要现在powerjob登录页执行应用注册后才能使用 + # 如何开启调度中心请查看文档教程 + enabled: false + # 需要先在 powerjob 登录页执行应用注册后才能使用 app-name: ruoyi-worker enable-test-mode: false max-appended-wf-context-length: 4096 max-result-length: 4096 port: 27777 protocol: http - server-address: 127.0.0.1:7700,127.0.0.1:7701 + server-address: 127.0.0.1:7700 store-strategy: disk --- # 数据源配置 diff --git a/ruoyi-extend/ruoyi-powerjob-server/Dockerfile b/ruoyi-extend/ruoyi-powerjob-server/Dockerfile new file mode 100644 index 000000000..e92de893b --- /dev/null +++ b/ruoyi-extend/ruoyi-powerjob-server/Dockerfile @@ -0,0 +1,13 @@ +FROM findepi/graalvm:java17-native + +MAINTAINER Lion Li + +RUN mkdir -p /ruoyi/powerjob/logs + +WORKDIR /ruoyi/powerjob + +EXPOSE 7700 + +ADD ./target/ruoyi-powerjob-server.jar ./app.jar + +ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"] diff --git a/ruoyi-extend/ruoyi-powerjob-server/pom.xml b/ruoyi-extend/ruoyi-powerjob-server/pom.xml index 7bac8b197..f771ae97c 100644 --- a/ruoyi-extend/ruoyi-powerjob-server/pom.xml +++ b/ruoyi-extend/ruoyi-powerjob-server/pom.xml @@ -1,18 +1,16 @@ - 4.0.0 org.dromara ruoyi-extend ${revision} - org.dromara - ruoyi-powerjob-server - ${revision} + 4.0.0 jar + ruoyi-powerjob-server - 2.7.4 + 2.7.12 diff --git a/ruoyi-extend/ruoyi-powerjob-server/src/main/java/org/dromara/powerjob/PowerJobServerApplication.java b/ruoyi-extend/ruoyi-powerjob-server/src/main/java/org/dromara/powerjob/PowerJobServerApplication.java new file mode 100644 index 000000000..3898639cf --- /dev/null +++ b/ruoyi-extend/ruoyi-powerjob-server/src/main/java/org/dromara/powerjob/PowerJobServerApplication.java @@ -0,0 +1,25 @@ +package org.dromara.powerjob; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.scheduling.annotation.EnableScheduling; +import tech.powerjob.server.common.utils.PropertyUtils; + +/** + * powerjob 启动程序 + * + * @author yhan219 + */ +@Slf4j +@EnableScheduling +@SpringBootApplication(scanBasePackages = "tech.powerjob.server") +public class PowerJobServerApplication { + + public static void main(String[] args) { + PropertyUtils.init(); + SpringApplication.run(tech.powerjob.server.PowerJobServerApplication.class, args); + log.info("文档地址: https://www.yuque.com/powerjob/guidence/problem"); + } + +} diff --git a/ruoyi-extend/ruoyi-powerjob-server/src/main/java/org/dromara/powerjob/server/RuoyiPowerJobServerApplication.java b/ruoyi-extend/ruoyi-powerjob-server/src/main/java/org/dromara/powerjob/server/RuoyiPowerJobServerApplication.java deleted file mode 100644 index ff8b06976..000000000 --- a/ruoyi-extend/ruoyi-powerjob-server/src/main/java/org/dromara/powerjob/server/RuoyiPowerJobServerApplication.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.dromara.powerjob.server; - -import lombok.extern.slf4j.Slf4j; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.scheduling.annotation.EnableScheduling; -import tech.powerjob.server.PowerJobServerApplication; -import tech.powerjob.server.common.utils.PropertyUtils; - -/** - * Admin 监控启动程序 - * - * @author yhan219 - */ -@Slf4j -@EnableScheduling -@SpringBootApplication(scanBasePackages = "tech.powerjob.server") -public class RuoyiPowerJobServerApplication { - - private static final String TIPS = "\n\n" + - "******************* PowerJob Tips *******************\n" + - "如果应用无法启动,我们建议您仔细阅读以下文档来解决:\n" + - "if server can't startup, we recommend that you read the documentation to find a solution:\n" + - "https://www.yuque.com/powerjob/guidence/problem\n" + - "******************* PowerJob Tips *******************\n\n"; - - public static void main(String[] args) { - - pre(); - - // Start SpringBoot application. - try { - SpringApplication.run(PowerJobServerApplication.class, args); - } catch (Throwable t) { - log.error(TIPS); - throw t; - } - } - - private static void pre() { - log.info(TIPS); - PropertyUtils.init(); - } - -} diff --git a/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/application-daily.properties b/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/application-dev.properties similarity index 97% rename from ruoyi-extend/ruoyi-powerjob-server/src/main/resources/application-daily.properties rename to ruoyi-extend/ruoyi-powerjob-server/src/main/resources/application-dev.properties index 5b07eec49..b3e342e14 100644 --- a/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/application-daily.properties +++ b/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/application-dev.properties @@ -1,5 +1,4 @@ -oms.env=DAILY -logging.config=classpath:logback-dev.xml +oms.env=dev ####### Database properties(Configure according to the the environment) ####### spring.datasource.core.driver-class-name=com.mysql.cj.jdbc.Driver diff --git a/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/application-pre.properties b/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/application-pre.properties deleted file mode 100644 index f08f673b8..000000000 --- a/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/application-pre.properties +++ /dev/null @@ -1,42 +0,0 @@ -oms.env=PRE -logging.config=classpath:logback-product.xml - -####### Database properties(Configure according to the the environment) ####### -spring.datasource.core.driver-class-name=com.mysql.cj.jdbc.Driver -spring.datasource.core.jdbc-url=jdbc:mysql://remotehost:3306/powerjob-pre?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai -spring.datasource.core.username=root -spring.datasource.core.password=No1Bug2Please3! -spring.datasource.core.maximum-pool-size=20 -spring.datasource.core.minimum-idle=5 - -####### MongoDB properties(Non-core configuration properties) ####### -####### delete mongodb config to disable mongodb ####### -oms.mongodb.enable=true -spring.data.mongodb.uri=mongodb://remotehost:27017/powerjob-pre - -####### Email properties(Non-core configuration properties) ####### -####### Delete the following code to disable the mail ####### -spring.mail.host=smtp.qq.com -spring.mail.username=zqq -spring.mail.password=qqz -spring.mail.properties.mail.smtp.auth=true -spring.mail.properties.mail.smtp.starttls.enable=true -spring.mail.properties.mail.smtp.starttls.required=true - -####### DingTalk properties(Non-core configuration properties) ####### -####### Delete the following code to disable the DingTalk ####### -oms.alarm.ding.app-key=dingauqwkvxxnqskknfv -oms.alarm.ding.app-secret=XWrEPdAZMPgJeFtHuL0LH73LRj-74umF2_0BFcoXMfvnX0pCQvt0rpb1JOJU_HLl -oms.alarm.ding.agent-id=847044348 - -####### Resource cleaning properties ####### -oms.instanceinfo.retention=3 -oms.container.retention.local=3 -oms.container.retention.remote=-1 - -####### Cache properties ####### -oms.instance.metadata.cache.size=1024 - -####### Threshold in precise fetching server(0~100). 100 means full detection of server, in which ####### -####### split-brain could be avoided while performance overhead would increase. ####### -oms.accurate.select.server.percentage = 50 \ No newline at end of file diff --git a/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/application-product.properties b/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/application-prod.properties similarity index 56% rename from ruoyi-extend/ruoyi-powerjob-server/src/main/resources/application-product.properties rename to ruoyi-extend/ruoyi-powerjob-server/src/main/resources/application-prod.properties index a3ed4fe19..6316e30e7 100644 --- a/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/application-product.properties +++ b/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/application-prod.properties @@ -1,33 +1,32 @@ -oms.env=PRODUCT -logging.config=classpath:logback-product.xml +oms.env=prod ####### Database properties(Configure according to the the environment) ####### spring.datasource.core.driver-class-name=com.mysql.cj.jdbc.Driver -spring.datasource.core.jdbc-url=jdbc:mysql://localhost:3306/powerjob-product?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai +spring.datasource.core.jdbc-url=jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai spring.datasource.core.username=root -spring.datasource.core.password=No1Bug2Please3! +spring.datasource.core.password=root spring.datasource.core.maximum-pool-size=20 spring.datasource.core.minimum-idle=5 ####### MongoDB properties(Non-core configuration properties) ####### ####### delete mongodb config to disable mongodb ####### -oms.mongodb.enable=true -spring.data.mongodb.uri=mongodb://localhost:27017/powerjob-product +#oms.mongodb.enable=true +#spring.data.mongodb.uri=mongodb+srv://zqq:No1Bug2Please3!@cluster0.wie54.gcp.mongodb.net/powerjob_daily?retryWrites=true&w=majority ####### Email properties(Non-core configuration properties) ####### ####### Delete the following code to disable the mail ####### -spring.mail.host=smtp.qq.com -spring.mail.username=zqq -spring.mail.password=qqz -spring.mail.properties.mail.smtp.auth=true -spring.mail.properties.mail.smtp.starttls.enable=true -spring.mail.properties.mail.smtp.starttls.required=true +#spring.mail.host=smtp.163.com +#spring.mail.username=zqq@163.com +#spring.mail.password=GOFZPNARMVKCGONV +#spring.mail.properties.mail.smtp.auth=true +#spring.mail.properties.mail.smtp.starttls.enable=true +#spring.mail.properties.mail.smtp.starttls.required=true ####### DingTalk properties(Non-core configuration properties) ####### ####### Delete the following code to disable the DingTalk ####### -oms.alarm.ding.app-key= -oms.alarm.ding.app-secret= -oms.alarm.ding.agent-id= +#oms.alarm.ding.app-key=dingauqwkvxxnqskknfv +#oms.alarm.ding.app-secret=XWrEPdAZMPgJeFtHuL0LH73LRj-74umF2_0BFcoXMfvnX0pCQvt0rpb1JOJU_HLl +#oms.alarm.ding.agent-id=847044348 ####### Resource cleaning properties ####### oms.instanceinfo.retention=7 @@ -39,4 +38,4 @@ oms.instance.metadata.cache.size=2048 ####### Threshold in precise fetching server(0~100). 100 means full detection of server, in which ####### ####### split-brain could be avoided while performance overhead would increase. ####### -oms.accurate.select.server.percentage = 50 \ No newline at end of file +oms.accurate.select.server.percentage = 50 diff --git a/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/application.properties b/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/application.properties index 6946a0e30..70284995b 100644 --- a/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/application.properties +++ b/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/application.properties @@ -1,11 +1,12 @@ # Http server port server.port=7700 -spring.profiles.active=daily +spring.profiles.active=@profiles.active@ spring.main.banner-mode=log spring.jpa.open-in-view=false spring.data.mongodb.repositories.type=none logging.level.org.mongodb=warn +logging.config: classpath:logback-plus.xml # Configuration for uploading files. spring.servlet.multipart.enabled=true diff --git a/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/banner.txt b/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/banner.txt index 82d536ace..c0fac79b2 100644 --- a/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/banner.txt +++ b/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/banner.txt @@ -1,15 +1,11 @@ -${AnsiColor.GREEN} - ███████ ██ ██ -░██░░░░██ ░██ ░██ -░██ ░██ ██████ ███ ██ █████ ██████ ░██ ██████ ░██ -░███████ ██░░░░██░░██ █ ░██ ██░░░██░░██░░█ ░██ ██░░░░██░██████ -░██░░░░ ░██ ░██ ░██ ███░██░███████ ░██ ░ ░██░██ ░██░██░░░██ -░██ ░██ ░██ ░████░████░██░░░░ ░██ ██ ░██░██ ░██░██ ░██ -░██ ░░██████ ███░ ░░░██░░██████░███ ░░█████ ░░██████ ░██████ -░░ ░░░░░░ ░░░ ░░░ ░░░░░░ ░░░ ░░░░░ ░░░░░░ ░░░░░ -${AnsiColor.BRIGHT_RED} -* Maintainer: tengjiqi@gmail.com & Team PowerJob -* OfficialWebsite: http://www.powerjob.tech/ -* SourceCode: https://github.com/PowerJob/PowerJob -* PoweredBy: SpringBoot${spring-boot.formatted-version} -${AnsiColor.DEFAULT} \ No newline at end of file +Application Version: ${revision} +Spring Boot Version: ${spring-boot.version} + _ _ + (_) | | + _ __ _____ _____ _ __ _ ___ | |__ ______ ___ ___ _ ____ _____ _ __ +| '_ \ / _ \ \ /\ / / _ \ '__| |/ _ \| '_ \______/ __|/ _ \ '__\ \ / / _ \ '__| +| |_) | (_) \ V V / __/ | | | (_) | |_) | \__ \ __/ | \ V / __/ | +| .__/ \___/ \_/\_/ \___|_| | |\___/|_.__/ |___/\___|_| \_/ \___|_| +| | _/ | +|_| |__/ + diff --git a/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/logback-dev.xml b/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/logback-dev.xml deleted file mode 100644 index 9951c3bc5..000000000 --- a/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/logback-dev.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - ${CONSOLE_LOG_PATTERN} - utf8 - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/logback-plus.xml b/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/logback-plus.xml new file mode 100644 index 000000000..658aeb0ff --- /dev/null +++ b/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/logback-plus.xml @@ -0,0 +1,132 @@ + + + + + + + + + + + + + ${console.log.pattern} + utf-8 + + + + + + ${log.path}/sys-console.log + + + ${log.path}/sys-console.%d{yyyy-MM-dd}.log + + 1 + + + ${log.pattern} + utf-8 + + + + INFO + + + + + + ${log.path}/sys-info.log + + + + ${log.path}/sys-info.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/sys-error.log + + + + ${log.path}/sys-error.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + ERROR + + ACCEPT + + DENY + + + + + + + 0 + + 512 + + + + + + + + 0 + + 512 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/logback-product.xml b/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/logback-product.xml deleted file mode 100644 index 80be04f6a..000000000 --- a/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/logback-product.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - ${LOG_PATH}/powerjob-server-error.log - - ${LOG_PATH}/powerjob-server-error.%d{yyyy-MM-dd}.log - 7 - - - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{20} - %msg%n - UTF-8 - - - ERROR - ACCEPT - DENY - - - - - - - ${LOG_PATH}/powerjob-server-web.log - - ${LOG_PATH}/powerjob-server-web.%d{yyyy-MM-dd}.log - 7 - - - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level - %msg%n - UTF-8 - - true - - - - - - - - - ${LOG_PATH}/powerjob-server-application.log - - ${LOG_PATH}/powerjob-server-application.%d{yyyy-MM-dd}.log - 7 - - - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{20} - %msg%n - UTF-8 - - true - - - - - - - - - - \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-job/pom.xml b/ruoyi-modules/ruoyi-job/pom.xml index 2fd78e9a7..2431a1ce8 100644 --- a/ruoyi-modules/ruoyi-job/pom.xml +++ b/ruoyi-modules/ruoyi-job/pom.xml @@ -20,15 +20,14 @@ org.dromara - ruoyi-common-core + ruoyi-common-json org.dromara ruoyi-common-job - - + diff --git a/ruoyi-modules/ruoyi-job/src/main/java/org/dromara/job/processors/MapProcessorDemo.java b/ruoyi-modules/ruoyi-job/src/main/java/org/dromara/job/processors/MapProcessorDemo.java index bb5529b7c..720d333e2 100644 --- a/ruoyi-modules/ruoyi-job/src/main/java/org/dromara/job/processors/MapProcessorDemo.java +++ b/ruoyi-modules/ruoyi-job/src/main/java/org/dromara/job/processors/MapProcessorDemo.java @@ -4,8 +4,8 @@ import com.google.common.collect.Lists; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; +import org.dromara.common.json.utils.JsonUtils; import org.springframework.stereotype.Component; -import tech.powerjob.common.serialize.JsonUtils; import tech.powerjob.worker.core.processor.ProcessResult; import tech.powerjob.worker.core.processor.TaskContext; import tech.powerjob.worker.core.processor.sdk.MapProcessor; @@ -37,7 +37,7 @@ public class MapProcessorDemo implements MapProcessor { log.info("============== MapProcessorDemo#process =============="); log.info("isRootTask:{}", isRootTask()); - log.info("taskContext:{}", JsonUtils.toJSONString(context)); + log.info("taskContext:{}", JsonUtils.toJsonString(context)); if (isRootTask()) { log.info("==== MAP ===="); diff --git a/ruoyi-modules/ruoyi-job/src/main/java/org/dromara/job/processors/MapReduceProcessorDemo.java b/ruoyi-modules/ruoyi-job/src/main/java/org/dromara/job/processors/MapReduceProcessorDemo.java index 0d02e8dae..149885465 100644 --- a/ruoyi-modules/ruoyi-job/src/main/java/org/dromara/job/processors/MapReduceProcessorDemo.java +++ b/ruoyi-modules/ruoyi-job/src/main/java/org/dromara/job/processors/MapReduceProcessorDemo.java @@ -1,15 +1,14 @@ package org.dromara.job.processors; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; +import cn.hutool.core.lang.Dict; import com.google.common.collect.Lists; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString; import lombok.extern.slf4j.Slf4j; +import org.dromara.common.json.utils.JsonUtils; import org.springframework.stereotype.Component; -import tech.powerjob.common.serialize.JsonUtils; import tech.powerjob.worker.core.processor.ProcessResult; import tech.powerjob.worker.core.processor.TaskContext; import tech.powerjob.worker.core.processor.TaskResult; @@ -37,10 +36,10 @@ public class MapReduceProcessorDemo implements MapReduceProcessor { log.info("============== TestMapReduceProcessor#process =============="); log.info("isRootTask:{}", isRootTask()); - log.info("taskContext:{}", JsonUtils.toJSONString(context)); + log.info("taskContext:{}", JsonUtils.toJsonString(context)); // 根据控制台参数获取MR批次及子任务大小 - final JSONObject jobParams = JSONObject.parseObject(context.getJobParams()); + final Dict jobParams = JsonUtils.parseMap(context.getJobParams()); Integer batchSize = (Integer) jobParams.getOrDefault("batchSize", 100); Integer batchNum = (Integer) jobParams.getOrDefault("batchNum", 10); @@ -61,8 +60,8 @@ public class MapReduceProcessorDemo implements MapReduceProcessor { return new ProcessResult(true, "MAP_SUCCESS"); } else { log.info("==== NORMAL_PROCESS ===="); - omsLogger.info("[DemoMRProcessor] process subTask: {}.", JSON.toJSONString(context.getSubTask())); - log.info("subTask: {}", JsonUtils.toJSONString(context.getSubTask())); + omsLogger.info("[DemoMRProcessor] process subTask: {}.", JsonUtils.toJsonString(context.getSubTask())); + log.info("subTask: {}", JsonUtils.toJsonString(context.getSubTask())); Thread.sleep(1000); if (context.getCurrentRetryTimes() == 0) { return new ProcessResult(false, "FIRST_FAILED"); @@ -75,8 +74,8 @@ public class MapReduceProcessorDemo implements MapReduceProcessor { @Override public ProcessResult reduce(TaskContext context, List taskResults) { log.info("================ MapReduceProcessorDemo#reduce ================"); - log.info("TaskContext: {}", JSONObject.toJSONString(context)); - log.info("List: {}", JSONObject.toJSONString(taskResults)); + log.info("TaskContext: {}", JsonUtils.toJsonString(context)); + log.info("List: {}", JsonUtils.toJsonString(taskResults)); context.getOmsLogger().info("MapReduce job finished, result is {}.", taskResults); boolean success = ThreadLocalRandom.current().nextBoolean(); diff --git a/script/sql/powerjob_demo.sql b/script/sql/powerjob_demo.sql index 2e9738a0e..eb8160149 100644 --- a/script/sql/powerjob_demo.sql +++ b/script/sql/powerjob_demo.sql @@ -1,4 +1,4 @@ -INSERT INTO `pj_app_info` (`id`, `app_name`, `current_server`, `gmt_create`, `gmt_modified`, `password`) VALUES (1, 'ruoyi-worker', '192.168.31.80:10010', '2023-06-13 16:32:59.263000', '2023-06-13 16:33:29.898000', 'ruoyi-worker'); +INSERT INTO `pj_app_info` (`id`, `app_name`, `current_server`, `gmt_create`, `gmt_modified`, `password`) VALUES (1, 'ruoyi-worker', '192.168.31.80:10010', '2023-06-13 16:32:59.263000', '2023-06-13 16:33:29.898000', '123456'); INSERT INTO `pj_job_info` (`id`, `alarm_config`, `app_id`, `concurrency`, `designated_workers`, `dispatch_strategy`, `execute_type`, `extra`, `gmt_create`, `gmt_modified`, `instance_retry_num`, `instance_time_limit`, `job_description`, `job_name`, `job_params`, `lifecycle`, `log_config`, `max_instance_num`, `max_worker_count`, `min_cpu_cores`, `min_disk_space`, `min_memory_space`, `next_trigger_time`, `notify_user_ids`, `processor_info`, `processor_type`, `status`, `tag`, `task_retry_num`, `time_expression`, `time_expression_type`) VALUES (1, '{\"alertThreshold\":0,\"silenceWindowLen\":0,\"statisticWindowLen\":0}', 1, 5, '', 2, 1, NULL, '2023-06-02 15:01:27.717000', '2023-06-02 16:03:19.462000', 1, 0, '', '单机处理器执行测试', NULL, '{}', '{\"type\":1}', 0, 0, 0, 0, 0, NULL, NULL, 'org.dromara.job.processors.StandaloneProcessorDemo', 1, 1, NULL, 1, '30000', 3); INSERT INTO `pj_job_info` (`id`, `alarm_config`, `app_id`, `concurrency`, `designated_workers`, `dispatch_strategy`, `execute_type`, `extra`, `gmt_create`, `gmt_modified`, `instance_retry_num`, `instance_time_limit`, `job_description`, `job_name`, `job_params`, `lifecycle`, `log_config`, `max_instance_num`, `max_worker_count`, `min_cpu_cores`, `min_disk_space`, `min_memory_space`, `next_trigger_time`, `notify_user_ids`, `processor_info`, `processor_type`, `status`, `tag`, `task_retry_num`, `time_expression`, `time_expression_type`) VALUES (2, '{\"alertThreshold\":0,\"silenceWindowLen\":0,\"statisticWindowLen\":0}', 1, 5, '', 1, 2, NULL, '2023-06-02 15:04:45.342000', '2023-06-02 16:04:09.736000', 0, 0, NULL, '广播处理器测试', NULL, '{}', '{\"type\":1}', 0, 0, 0, 0, 0, NULL, NULL, 'org.dromara.job.processors.BroadcastProcessorDemo', 1, 1, NULL, 1, '30000', 3); INSERT INTO `pj_job_info` (`id`, `alarm_config`, `app_id`, `concurrency`, `designated_workers`, `dispatch_strategy`, `execute_type`, `extra`, `gmt_create`, `gmt_modified`, `instance_retry_num`, `instance_time_limit`, `job_description`, `job_name`, `job_params`, `lifecycle`, `log_config`, `max_instance_num`, `max_worker_count`, `min_cpu_cores`, `min_disk_space`, `min_memory_space`, `next_trigger_time`, `notify_user_ids`, `processor_info`, `processor_type`, `status`, `tag`, `task_retry_num`, `time_expression`, `time_expression_type`) VALUES (3, '{\"alertThreshold\":0,\"silenceWindowLen\":0,\"statisticWindowLen\":0}', 1, 5, '', 1, 4, NULL, '2023-06-02 15:13:23.519000', '2023-06-02 16:03:22.421000', 0, 0, NULL, 'Map处理器测试', NULL, '{}', '{\"type\":1}', 0, 0, 0, 0, 0, NULL, NULL, 'org.dromara.job.processors.MapProcessorDemo', 1, 2, NULL, 1, '1000', 3); diff --git a/script/sql/update/oracle/update_5.0-5.1.sql b/script/sql/update/oracle/update_5.0-5.1.sql index 69fccd6ea..551e97514 100644 --- a/script/sql/update/oracle/update_5.0-5.1.sql +++ b/script/sql/update/oracle/update_5.0-5.1.sql @@ -1,3 +1,5 @@ ALTER TABLE gen_table ADD (data_name VARCHAR2(200) DEFAULT ''); COMMENT ON COLUMN gen_table.data_name IS '数据源名称'; + +UPDATE sys_menu SET path = 'powerjob', component = 'monitor/powerjob/index', perms = 'monitor:powerjob:list', remark = 'powerjob控制台菜单' WHERE menu_id = 120; diff --git a/script/sql/update/postgres/update_5.0-5.1.sql b/script/sql/update/postgres/update_5.0-5.1.sql index f802788fa..4fa7f2dcf 100644 --- a/script/sql/update/postgres/update_5.0-5.1.sql +++ b/script/sql/update/postgres/update_5.0-5.1.sql @@ -1,3 +1,5 @@ ALTER TABLE gen_table ADD data_name varchar(200) default ''::varchar; COMMENT ON COLUMN gen_table.data_name IS '数据源名称'; + +UPDATE sys_menu SET path = 'powerjob', component = 'monitor/powerjob/index', perms = 'monitor:powerjob:list', remark = 'powerjob控制台菜单' WHERE menu_id = 120; diff --git a/script/sql/update/sqlserver/update_5.0-5.1.sql b/script/sql/update/sqlserver/update_5.0-5.1.sql index 8fd249f4b..835ca20c5 100644 --- a/script/sql/update/sqlserver/update_5.0-5.1.sql +++ b/script/sql/update/sqlserver/update_5.0-5.1.sql @@ -7,3 +7,6 @@ EXEC sp_addextendedproperty 'TABLE', N'gen_table', 'COLUMN', N'data_name' GO + +UPDATE sys_menu SET path = 'powerjob', component = 'monitor/powerjob/index', perms = 'monitor:powerjob:list', remark = 'powerjob控制台菜单' WHERE menu_id = 120 +GO diff --git a/script/sql/update/update_5.0-5.1.sql b/script/sql/update/update_5.0-5.1.sql index 897fb4c4c..29595209d 100644 --- a/script/sql/update/update_5.0-5.1.sql +++ b/script/sql/update/update_5.0-5.1.sql @@ -1 +1,3 @@ ALTER TABLE gen_table ADD COLUMN data_name varchar(200) NULL DEFAULT '' COMMENT '数据源名称' AFTER table_id; + +UPDATE sys_menu SET path = 'powerjob', component = 'monitor/powerjob/index', perms = 'monitor:powerjob:list', remark = 'powerjob控制台菜单' WHERE menu_id = 120