update 优化 !pr493 代码结构与问题修复
¶Ô±ÈÐÂÎļþ |
| | |
| | | easy-retry: |
| | | # å½å使ç¨çæ°æ®åºç±»å |
| | | db-type: mysql |
| | | spring: |
| | | datasource: |
| | | type: com.zaxxer.hikari.HikariDataSource |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true |
| | | username: root |
| | | password: root |
| | | hikari: |
| | | connection-timeout: 30000 |
| | | validation-timeout: 5000 |
| | | minimum-idle: 10 |
| | | maximum-pool-size: 20 |
| | | idle-timeout: 600000 |
| | | max-lifetime: 900000 |
| | | keepaliveTime: 30000 |
| | | |
| | | --- # easy-retry æå¡ç«¯é
ç½® |
| | | easy-retry: |
| | | # æåéè¯æ°æ®çæ¯æ¹æ¬¡çå¤§å° |
| | | retry-pull-page-size: 1000 |
| | | # æåéè¯æ°æ®çæ¯æ¹æ¬¡çå¤§å° |
| | | job-pull-page-size: 1000 |
| | | # æå¡ç«¯ netty ç«¯å£ |
| | | netty-port: 1788 |
| | | # éè¯åæ»ä¿¡è¡¨çååºæ»æ° |
| | | total-partition: 2 |
| | | # ä¸ä¸ªå®¢æ·ç«¯æ¯ç§æå¤æ¥æ¶çéè¯æ°éæä»¤ |
| | | limiter: 1000 |
| | | # å·æ®µæ¨¡å¼ä¸æ¥é¿é
ç½® |
| | | step: 100 |
| | | # æ¥å¿ä¿åæ¶é´(åä½: day) |
| | | log-storage: 90 |
| | | # åè°é
ç½® |
| | | callback: |
| | | #åè°æå¤§æ§è¡æ¬¡æ° |
| | | max-count: 288 |
| | | #é´éæ¶é´ |
| | | trigger-interval: 900 |
| | | mode: all |
| | | retry-max-pull-count: 10 |
| | | |
| | | --- # çæ§ä¸å¿é
ç½® |
| | | spring.boot.admin.client: |
| | | # å¢å 客æ·ç«¯å¼å
³ |
| | | enabled: true |
| | | url: http://localhost:9090/admin |
| | | instance: |
| | | service-host-type: IP |
| | | username: ruoyi |
| | | password: 123456 |
¶Ô±ÈÐÂÎļþ |
| | |
| | | easy-retry: |
| | | # å½å使ç¨çæ°æ®åºç±»å |
| | | db-type: mysql |
| | | spring: |
| | | datasource: |
| | | type: com.zaxxer.hikari.HikariDataSource |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true |
| | | username: root |
| | | password: root |
| | | hikari: |
| | | connection-timeout: 30000 |
| | | validation-timeout: 5000 |
| | | minimum-idle: 10 |
| | | maximum-pool-size: 20 |
| | | idle-timeout: 600000 |
| | | max-lifetime: 900000 |
| | | keepaliveTime: 30000 |
| | | |
| | | --- # easy-retry æå¡ç«¯é
ç½® |
| | | easy-retry: |
| | | # æåéè¯æ°æ®çæ¯æ¹æ¬¡çå¤§å° |
| | | retry-pull-page-size: 1000 |
| | | # æåéè¯æ°æ®çæ¯æ¹æ¬¡çå¤§å° |
| | | job-pull-page-size: 1000 |
| | | # æå¡ç«¯ netty ç«¯å£ |
| | | netty-port: 1788 |
| | | # éè¯åæ»ä¿¡è¡¨çååºæ»æ° |
| | | total-partition: 2 |
| | | # ä¸ä¸ªå®¢æ·ç«¯æ¯ç§æå¤æ¥æ¶çéè¯æ°éæä»¤ |
| | | limiter: 1000 |
| | | # å·æ®µæ¨¡å¼ä¸æ¥é¿é
ç½® |
| | | step: 100 |
| | | # æ¥å¿ä¿åæ¶é´(åä½: day) |
| | | log-storage: 90 |
| | | # åè°é
ç½® |
| | | callback: |
| | | #åè°æå¤§æ§è¡æ¬¡æ° |
| | | max-count: 288 |
| | | #é´éæ¶é´ |
| | | trigger-interval: 900 |
| | | mode: all |
| | | retry-max-pull-count: 10 |
| | | |
| | | --- # çæ§ä¸å¿é
ç½® |
| | | spring.boot.admin.client: |
| | | # å¢å 客æ·ç«¯å¼å
³ |
| | | enabled: true |
| | | url: http://localhost:9090/admin |
| | | instance: |
| | | service-host-type: IP |
| | | username: ruoyi |
| | | password: 123456 |
| | |
| | | port: 8800 |
| | | servlet: |
| | | context-path: /easy-retry |
| | | |
| | | spring: |
| | | application: |
| | | name: ruoyi-easyretry-server |
| | | profiles: |
| | | active: @profiles.active@ |
| | | datasource: |
| | | name: ry-vue |
| | | url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true |
| | | username: root |
| | | password: root |
| | | type: com.zaxxer.hikari.HikariDataSource |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | hikari: |
| | | connection-timeout: 30000 |
| | | minimum-idle: 5 |
| | | maximum-pool-size: 20 |
| | | auto-commit: true |
| | | idle-timeout: 30000 |
| | | pool-name: easy_retry |
| | | max-lifetime: 1800000 |
| | | web: |
| | | resources: |
| | | static-locations: classpath:admin/ |
| | |
| | | configuration: |
| | | map-underscore-to-camel-case: true |
| | | cache-enabled: true |
| | | |
| | | logging: |
| | | config: classpath:logback-boot.xml |
| | | config: classpath:logback-plus.xml |
| | | |
| | | easy-retry: |
| | | retry-pull-page-size: 1000 # æåéè¯æ°æ®çæ¯æ¹æ¬¡çå¤§å° |
| | | job-pull-page-size: 1000 # æåéè¯æ°æ®çæ¯æ¹æ¬¡çå¤§å° |
| | | netty-port: 1788 # æå¡ç«¯nettyç«¯å£ |
| | | total-partition: 2 # éè¯åæ»ä¿¡è¡¨çååºæ»æ° |
| | | limiter: 1000 # ä¸ä¸ªå®¢æ·ç«¯æ¯ç§æå¤æ¥æ¶çéè¯æ°éæä»¤ |
| | | step: 100 # å·æ®µæ¨¡å¼ä¸æ¥é¿é
ç½® |
| | | log-storage: 90 # æ¥å¿ä¿åæ¶é´(åä½: day) |
| | | callback: # åè°é
ç½® |
| | | max-count: 288 #åè°æå¤§æ§è¡æ¬¡æ° |
| | | trigger-interval: 900 #é´éæ¶é´ |
| | | db-type: mysql #å½å使ç¨çæ°æ®åº |
| | | mode: all |
| | | retry-max-pull-count: 10 |
| | | |
| | | --- # çæ§ä¸å¿é
ç½® |
| | | spring.boot.admin.client: |
| | | # å¢å 客æ·ç«¯å¼å
³ |
| | | enabled: true |
| | | url: http://localhost:9090/admin |
| | | instance: |
| | | service-host-type: IP |
| | | username: ruoyi |
| | | password: 123456 |
| | | management: |
| | | endpoints: |
| | | web: |
| | | exposure: |
| | | include: '*' |
| | | endpoint: |
| | | health: |
| | | show-details: ALWAYS |
| | | logfile: |
| | | external-file: ./logs/ruoyi-easyretry-server/console.log |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Application Version: ${revision} |
| | | Spring Boot Version: ${spring-boot.version} |
| | | _ |
| | | | | |
| | | ___ __ _ ___ _ _ ______ _ __ ___| |_ _ __ _ _ ______ ___ ___ _ ____ _____ _ __ |
| | | / _ \/ _` / __| | | |______| '__/ _ \ __| '__| | | |______/ __|/ _ \ '__\ \ / / _ \ '__| |
| | | | __/ (_| \__ \ |_| | | | | __/ |_| | | |_| | \__ \ __/ | \ V / __/ | |
| | | \___|\__,_|___/\__, | |_| \___|\__|_| \__, | |___/\___|_| \_/ \___|_| |
| | | __/ | __/ | |
| | | |___/ |___/ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <configuration> |
| | | |
| | | <property name="log.path" value="./logs/ruoyi-easyretry-server" /> |
| | | <property name="console.log.pattern" |
| | | value="%red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}%n) - %msg%n"/> |
| | | <property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"/> |
| | | |
| | | |
| | | <!-- æ§å¶å°è¾åº --> |
| | | <appender name="console" class="ch.qos.logback.core.ConsoleAppender"> |
| | | <encoder> |
| | | <pattern>${console.log.pattern}</pattern> |
| | | <charset>utf-8</charset> |
| | | </encoder> |
| | | </appender> |
| | | |
| | | <!-- æ§å¶å°è¾åº --> |
| | | <appender name="file_console" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <file>${log.path}/console.log</file> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- æ¥å¿æä»¶åæ ¼å¼ --> |
| | | <fileNamePattern>${log.path}/console.%d{yyyy-MM-dd}.log</fileNamePattern> |
| | | <!-- æ¥å¿æå¤§ 1天 --> |
| | | <maxHistory>1</maxHistory> |
| | | </rollingPolicy> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | <charset>utf-8</charset> |
| | | </encoder> |
| | | <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> |
| | | <!-- è¿æ»¤ççº§å« --> |
| | | <level>INFO</level> |
| | | </filter> |
| | | </appender> |
| | | |
| | | <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <file>${log.path}/info.log</file> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <FileNamePattern>${log.base}/info.%d{yyyy-MM-dd}.log</FileNamePattern> |
| | | <MaxHistory>60</MaxHistory> |
| | | </rollingPolicy> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>INFO</level> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | |
| | | <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <file>${log.base}/error.log</file> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <FileNamePattern>${log.base}/error.%d{yyyy-MM-dd}.log |
| | | </FileNamePattern> |
| | | <MaxHistory>60</MaxHistory> |
| | | </rollingPolicy> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>ERROR</level> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | |
| | | <appender name ="async_info" class= "ch.qos.logback.classic.AsyncAppender"> |
| | | <discardingThreshold >100</discardingThreshold> |
| | | <queueSize>1024</queueSize> |
| | | <appender-ref ref ="file_info"/> |
| | | </appender> |
| | | |
| | | <appender name ="async_error" class= "ch.qos.logback.classic.AsyncAppender"> |
| | | <discardingThreshold >100</discardingThreshold> |
| | | <queueSize>1024</queueSize> |
| | | <appender-ref ref ="file_error"/> |
| | | </appender> |
| | | |
| | | <!-- EasyRetry appender --> |
| | | <appender name="easy_log_server_appender" class="com.aizuda.easy.retry.server.job.task.support.appender.EasyRetryServerLogbackAppender"> |
| | | </appender> |
| | | |
| | | <!-- æ§å¶å°è¾åºæ¥å¿çº§å« --> |
| | | <root level="info"> |
| | | <appender-ref ref="console" /> |
| | | <appender-ref ref="async_info" /> |
| | | <appender-ref ref="async_error" /> |
| | | <appender-ref ref="easy_log_server_appender" /> |
| | | </root> |
| | | </configuration> |
| | |
| | | import com.aizuda.easy.retry.client.job.core.annotation.JobExecutor; |
| | | import com.aizuda.easy.retry.client.job.core.dto.JobArgs; |
| | | import com.aizuda.easy.retry.client.model.ExecuteResult; |
| | | import com.aizuda.easy.retry.common.core.util.JsonUtil; |
| | | import com.aizuda.easy.retry.common.log.EasyRetryLog; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * @author www.byteblogs.com |
| | | * @date 2023-09-28 22:54:07 |
| | | * @since 2.4.0 |
| | | */ |
| | | @Component |
| | | @JobExecutor(name = "testJobExecutor") |
| | | public class TestAnnoJobExecutor { |
| | | |
| | | public ExecuteResult jobExecute(JobArgs jobArgs) { |
| | | EasyRetryLog.LOCAL.info("testJobExecutor. jobArgs:{}", JsonUtil.toJsonString(jobArgs)); |
| | | EasyRetryLog.REMOTE.info("testJobExecutor. jobArgs:{}", JsonUtil.toJsonString(jobArgs)); |
| | | return ExecuteResult.success("æµè¯æå"); |
| | | } |
| | | } |
| | |
| | | /** |
| | | * @author www.byteblogs.com |
| | | * @date 2023-09-28 22:54:07 |
| | | * @since 2.4.0 |
| | | */ |
| | | @Component |
| | | public class TestClassJobExecutor extends AbstractJobExecutor { |
| | |
| | | ) ENGINE = InnoDB |
| | | DEFAULT CHARSET = utf8mb4 COMMENT ='å½å空é´'; |
| | | |
| | | INSERT INTO `namespace` (`id`, `name`, `unique_id`, `create_dt`, `update_dt`, `deleted`) |
| | | VALUES (1, 'Development', 'dev', now(), now(), 0); |
| | | INSERT INTO `namespace` (`id`, `name`, `unique_id`, `create_dt`, `update_dt`, `deleted`) |
| | | VALUES (2, 'Production', 'prod', now(), now(), 0); |
| | | INSERT INTO `namespace` VALUES (1, 'Development', 'dev', '', now(), now(), 0); |
| | | INSERT INTO `namespace` VALUES (2, 'Production', 'prod', '', now(), now(), 0); |
| | | |
| | | DROP TABLE IF EXISTS `group_config`; |
| | | CREATE TABLE `group_config` |
| | |
| | | DEFAULT CHARSET = utf8mb4 COMMENT ='ç»é
ç½®' |
| | | ; |
| | | |
| | | INSERT INTO `ry-vue`.group_config (id, namespace_id, group_name, description, group_status, version, group_partition, id_generator_mode, init_scene, bucket_index, create_dt, update_dt) |
| | | VALUES (1, 'dev', 'ruoyi_group', '', 1, 1, 0, 1, 1, 4, '2024-03-13 23:21:41', '2024-03-13 23:21:40'); |
| | | INSERT INTO `group_config` VALUES (1, 'dev', 'ruoyi_group', '', 1, 1, 0, 1, 1, 4, now(), now()); |
| | | |
| | | DROP TABLE IF EXISTS `notify_config`; |
| | | CREATE TABLE `notify_config` |
| | |
| | | DEFAULT CHARSET = utf8mb4 COMMENT ='ç³»ç»ç¨æ·è¡¨'; |
| | | |
| | | -- pwd: admin |
| | | INSERT INTO system_user (username, password, role) |
| | | VALUES ('admin', '465c194afb65670f38322df087f0a9bb225cc257e43eb4ac5a0c98ef5b3173ac', 2); |
| | | INSERT INTO `system_user` VALUES (1, 'admin', '465c194afb65670f38322df087f0a9bb225cc257e43eb4ac5a0c98ef5b3173ac', 2, now(), now()); |
| | | |
| | | DROP TABLE IF EXISTS `system_user_permission`; |
| | | CREATE TABLE `system_user_permission` |
| | |
| | | AUTO_INCREMENT = 0 |
| | | DEFAULT CHARSET = utf8mb4 COMMENT ='ä»»å¡ä¿¡æ¯'; |
| | | |
| | | INSERT INTO job (id, namespace_id, group_name, job_name, args_str, args_type, next_trigger_at, job_status, task_type, route_key, executor_type, executor_info, trigger_type, trigger_interval, block_strategy, executor_timeout, max_retry_times, parallel_num, retry_interval, bucket_index, resident, description, ext_attrs, create_dt, update_dt, deleted) |
| | | VALUES (1, 'dev', 'ruoyi_group', 'demo-job', null, 1, 1710344035622, 1, 1, 4, 1, 'testJobExecutor', 2, '60', 1, 60, 3, 1, 1, 116, 0, '', '', '2024-03-13 22:59:39', '2024-03-13 23:32:52', 0); |
| | | INSERT INTO `job` VALUES (1, 'dev', 'ruoyi_group', 'demo-job', null, 1, 1710344035622, 1, 1, 4, 1, 'testJobExecutor', 2, '60', 1, 60, 3, 1, 1, 116, 0, '', '', now(), now(), 0); |
| | | |
| | | DROP TABLE IF EXISTS `job_log_message`; |
| | | CREATE TABLE `job_log_message` |
| | |
| | | COMMENT ON COLUMN namespace.deleted IS 'é»è¾å é¤ 1ãå é¤'; |
| | | COMMENT ON TABLE namespace IS 'å½å空é´'; |
| | | |
| | | INSERT INTO namespace (name, unique_id, create_dt, update_dt, deleted) |
| | | VALUES ('Default', '764d604ec6fc45f68cd92514c40e9e1a', now(), now(), 0); |
| | | INSERT INTO namespace VALUES (1, 'Development', 'dev', '', now(), now(), 0); |
| | | INSERT INTO namespace VALUES (2, 'Production', 'prod', '', now(), now(), 0); |
| | | |
| | | CREATE TABLE group_config |
| | | ( |
| | |
| | | COMMENT ON COLUMN "group_config"."update_dt" IS 'ä¿®æ¹æ¶é´'; |
| | | COMMENT ON TABLE "group_config" IS 'ç»é
ç½®'; |
| | | |
| | | INSERT INTO `namespace` (`id`, `name`, `unique_id`, `create_dt`, `update_dt`, `deleted`) |
| | | VALUES (1, 'Development', 'dev', now(), now(), 0); |
| | | INSERT INTO `namespace` (`id`, `name`, `unique_id`, `create_dt`, `update_dt`, `deleted`) |
| | | VALUES (2, 'Production', 'prod', now(), now(), 0); |
| | | INSERT INTO group_config VALUES (1, 'dev', 'ruoyi_group', '', 1, 1, 0, 1, 1, 4, now(), now()); |
| | | |
| | | CREATE TABLE notify_config |
| | | ( |
| | |
| | | COMMENT ON TABLE "system_user" IS 'ç³»ç»ç¨æ·è¡¨'; |
| | | |
| | | -- pwd: admin |
| | | INSERT INTO system_user (username, password, role) |
| | | VALUES ('admin', '465c194afb65670f38322df087f0a9bb225cc257e43eb4ac5a0c98ef5b3173ac', 2); |
| | | INSERT INTO system_user VALUES (1, 'admin', '465c194afb65670f38322df087f0a9bb225cc257e43eb4ac5a0c98ef5b3173ac', 2, now(), now()); |
| | | |
| | | |
| | | CREATE TABLE system_user_permission |
| | | ( |
| | |
| | | COMMENT ON COLUMN "job"."update_dt" IS 'æ´æ°æ¶é´'; |
| | | COMMENT ON TABLE "job" IS 'ä»»å¡ä¿¡æ¯'; |
| | | |
| | | INSERT INTO job (id, namespace_id, group_name, job_name, args_str, args_type, next_trigger_at, job_status, task_type, route_key, executor_type, executor_info, trigger_type, trigger_interval, block_strategy, executor_timeout, max_retry_times, parallel_num, retry_interval, bucket_index, resident, description, ext_attrs, create_dt, update_dt, deleted) |
| | | VALUES (1, 'dev', 'ruoyi_group', 'demo-job', null, 1, 1710344035622, 1, 1, 4, 1, 'testJobExecutor', 2, '60', 1, 60, 3, 1, 1, 116, 0, '', '', '2024-03-13 22:59:39', '2024-03-13 23:32:52', 0); |
| | | INSERT INTO job VALUES (1, 'dev', 'ruoyi_group', 'demo-job', null, 1, 1710344035622, 1, 1, 4, 1, 'testJobExecutor', 2, '60', 1, 60, 3, 1, 1, 116, 0, '', '', now(), now(), 0); |
| | | |
| | | CREATE TABLE job_log_message |
| | | ( |