+ * 127.0.0.1:7700 + *
+ * Example of Powerjob-server cluster: + *+ * 192.168.0.10:7700,192.168.0.11:7700,192.168.0.12:7700 + *
*/ private String serverAddress; /** - * 本地持久化方式,默认使用磁盘 + * Local store strategy for H2 database. {@code disk} or {@code memory}. */ private StoreStrategy storeStrategy = StoreStrategy.DISK; /** - * 最大返回值长度,超过会被截断 - * {@link ProcessResult}#msg 的最大长度 + * Max length of response result. Result that is longer than the value will be truncated. + * {@link ProcessResult} max length for #msg */ private int maxResultLength = 8096; /** - * 启动测试模式,true情况下,不再尝试连接 server 并验证appName。 - * true -> 用于本地写单元测试调试; false -> 默认值,标准模式 + * If test mode is set as true, Powerjob-worker no longer connects to the server or validates appName. + * Test mode is used for conditions that your worker does not need to run the codes, i.e. when you + * write junit tests in local environment. {@code true} means test mode is enabled. {@code false} means + * normal mode is applied. */ private boolean enableTestMode = false; } diff --git a/powerjob-worker-spring-boot-starter/src/main/resources/META-INF/spring-configuration-metadata.json b/powerjob-worker-spring-boot-starter/src/main/resources/META-INF/spring-configuration-metadata.json index a67473e2..01a0eb3d 100644 --- a/powerjob-worker-spring-boot-starter/src/main/resources/META-INF/spring-configuration-metadata.json +++ b/powerjob-worker-spring-boot-starter/src/main/resources/META-INF/spring-configuration-metadata.json @@ -16,39 +16,39 @@ { "name": "powerjob.worker.akka-port", "type": "java.lang.Integer", - "description": "启动 akka 端口", + "description": "Akka port of PowerJob-worker", "sourceType": "com.github.kfcfans.powerjob.worker.autoconfigure.PowerJobProperties$Worker" }, { "name": "powerjob.worker.app-name", "type": "java.lang.String", - "description": "应用名称,需要提前在控制台注册,否则启动报错", + "description": "Name of application. Register in PowerJob-console to prevent error.", "sourceType": "com.github.kfcfans.powerjob.worker.autoconfigure.PowerJobProperties$Worker" }, { "name": "powerjob.worker.enable-test-mode", "type": "java.lang.Boolean", - "description": "启动测试模式,true情况下,不再尝试连接 server 并验证appName。 true -> 用于本地写单元测试调试; false -> 默认值,标准模式", + "description": "Whether to enable test mode. In test mode, worker will not connect to server.", "sourceType": "com.github.kfcfans.powerjob.worker.autoconfigure.PowerJobProperties$Worker", "defaultValue": false }, { "name": "powerjob.worker.max-result-length", "type": "java.lang.Integer", - "description": "最大返回值长度,超过会被截断 {@link ProcessResult}#msg 的最大长度", + "description": "Max length for {@link ProcessResult}#msg, result longer than this property will be truncated.", "sourceType": "com.github.kfcfans.powerjob.worker.autoconfigure.PowerJobProperties$Worker", "defaultValue": 8096 }, { "name": "powerjob.worker.server-address", "type": "java.lang.String", - "description": "调度服务器地址,ip:port 或 域名,多个用英文逗号分隔", + "description": "PowerJob-server node(s) address. Ip:port or domain, multiple addresses should be separated with comma", "sourceType": "com.github.kfcfans.powerjob.worker.autoconfigure.PowerJobProperties$Worker" }, { "name": "powerjob.worker.store-strategy", "type": "com.github.kfcfans.powerjob.worker.common.constants.StoreStrategy", - "description": "本地持久化方式,默认使用磁盘", + "description": "Local store strategy, disk or memory", "sourceType": "com.github.kfcfans.powerjob.worker.autoconfigure.PowerJobProperties$Worker" } ], diff --git a/powerjob-worker-spring-boot-starter/src/test/java/com/github/kfcfans/powerjob/worker/autoconfigure/PowerJobAutoConfigurationTest.java b/powerjob-worker-spring-boot-starter/src/test/java/com/github/kfcfans/powerjob/worker/autoconfigure/PowerJobAutoConfigurationTest.java index dd90d395..62dfa4a2 100644 --- a/powerjob-worker-spring-boot-starter/src/test/java/com/github/kfcfans/powerjob/worker/autoconfigure/PowerJobAutoConfigurationTest.java +++ b/powerjob-worker-spring-boot-starter/src/test/java/com/github/kfcfans/powerjob/worker/autoconfigure/PowerJobAutoConfigurationTest.java @@ -1,7 +1,7 @@ package com.github.kfcfans.powerjob.worker.autoconfigure; import com.github.kfcfans.powerjob.worker.OhMyWorker; -import org.junit.Assert; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -16,7 +16,7 @@ class PowerJobAutoConfigurationTest { void testAutoConfiguration() { ConfigurableApplicationContext run = SpringApplication.run(PowerJobAutoConfigurationTest.class); OhMyWorker worker = run.getBean(OhMyWorker.class); - Assert.assertNotNull(worker); + Assertions.assertNotNull(worker); } } diff --git a/powerjob-worker-spring-boot-starter/src/test/resources/application.properties b/powerjob-worker-spring-boot-starter/src/test/resources/application.properties index fbcb42fa..46f6cdd3 100644 --- a/powerjob-worker-spring-boot-starter/src/test/resources/application.properties +++ b/powerjob-worker-spring-boot-starter/src/test/resources/application.properties @@ -1,2 +1 @@ - powerjob.enable-test-mode=true \ No newline at end of file