feat: 3.2.0
1. 修复启动失败 2. 维护sql脚本
This commit is contained in:
parent
ffe8b7bac9
commit
8da3661f20
@ -412,7 +412,7 @@ CREATE TABLE `job_summary`
|
|||||||
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
|
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
`namespace_id` VARCHAR(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
|
`namespace_id` VARCHAR(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
|
||||||
`group_name` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '组名称',
|
`group_name` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '组名称',
|
||||||
`job_id` bigint NOT NULL COMMENT '任务信息id',
|
ji `business_id` bigint NOT NULL COMMENT '业务id (job_id或workflow_id)',
|
||||||
`trigger_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '统计时间',
|
`trigger_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '统计时间',
|
||||||
`success_num` int NOT NULL DEFAULT '0' COMMENT '执行成功-日志数量',
|
`success_num` int NOT NULL DEFAULT '0' COMMENT '执行成功-日志数量',
|
||||||
`fail_num` int NOT NULL DEFAULT '0' COMMENT '执行失败-日志数量',
|
`fail_num` int NOT NULL DEFAULT '0' COMMENT '执行失败-日志数量',
|
||||||
@ -424,8 +424,8 @@ CREATE TABLE `job_summary`
|
|||||||
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||||
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
KEY `idx_namespace_id_group_name_job_id` (`namespace_id`, `group_name`, job_id),
|
KEY `idx_namespace_id_group_name_business_id` (`namespace_id`, `group_name`, business_id),
|
||||||
UNIQUE KEY `uk_job_id_trigger_at` (`job_id`, `trigger_at`) USING BTREE
|
UNIQUE KEY `uk_business_id_trigger_at` (`business_id`, `trigger_at`) USING BTREE
|
||||||
) ENGINE = InnoDB
|
) ENGINE = InnoDB
|
||||||
AUTO_INCREMENT = 1
|
AUTO_INCREMENT = 1
|
||||||
DEFAULT CHARSET = utf8mb4 COMMENT ='DashBoard_Job';
|
DEFAULT CHARSET = utf8mb4 COMMENT ='DashBoard_Job';
|
||||||
|
@ -123,7 +123,7 @@ public class EasyRetryProperties {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String getGroup() {
|
public static String getGroup() {
|
||||||
EasyRetryProperties properties = SpringContext.CONTEXT.getBean(EasyRetryProperties.class);
|
EasyRetryProperties properties = SpringContext.getBean(EasyRetryProperties.class);
|
||||||
return Objects.requireNonNull(properties).group;
|
return Objects.requireNonNull(properties).group;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import com.aizuda.easy.retry.client.common.event.EasyRetryClosingEvent;
|
|||||||
import com.aizuda.easy.retry.client.common.event.EasyRetryStartingEvent;
|
import com.aizuda.easy.retry.client.common.event.EasyRetryStartingEvent;
|
||||||
import com.aizuda.easy.retry.common.core.context.SpringContext;
|
import com.aizuda.easy.retry.common.core.context.SpringContext;
|
||||||
import com.aizuda.easy.retry.common.core.util.EasyRetryVersion;
|
import com.aizuda.easy.retry.common.core.util.EasyRetryVersion;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.ApplicationListener;
|
import org.springframework.context.ApplicationListener;
|
||||||
@ -22,18 +23,17 @@ import java.util.List;
|
|||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
|
@RequiredArgsConstructor
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class EasyRetryCloseListener implements ApplicationListener<ContextClosedEvent> {
|
public class EasyRetryCloseListener implements ApplicationListener<ContextClosedEvent> {
|
||||||
|
private final List<Lifecycle> lifecycleList;
|
||||||
@Autowired
|
|
||||||
private List<Lifecycle> lifecycleList;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onApplicationEvent(ContextClosedEvent event) {
|
public void onApplicationEvent(ContextClosedEvent event) {
|
||||||
log.info("Easy-Retry client about to shutdown v{}", EasyRetryVersion.getVersion());
|
log.info("Easy-Retry client about to shutdown v{}", EasyRetryVersion.getVersion());
|
||||||
SpringContext.CONTEXT.publishEvent(new EasyRetryClosingEvent());
|
SpringContext.getContext().publishEvent(new EasyRetryClosingEvent());
|
||||||
lifecycleList.forEach(Lifecycle::close);
|
lifecycleList.forEach(Lifecycle::close);
|
||||||
SpringContext.CONTEXT.publishEvent(new EasyRetryClosedEvent());
|
SpringContext.getContext().publishEvent(new EasyRetryClosedEvent());
|
||||||
log.info("Easy-Retry client closed successfully v{}", EasyRetryVersion.getVersion());
|
log.info("Easy-Retry client closed successfully v{}", EasyRetryVersion.getVersion());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,9 +37,9 @@ public class EasyRetryStartListener implements ApplicationRunner {
|
|||||||
|
|
||||||
System.out.println(MessageFormatter.format(SystemConstants.LOGO, EasyRetryVersion.getVersion()).getMessage());
|
System.out.println(MessageFormatter.format(SystemConstants.LOGO, EasyRetryVersion.getVersion()).getMessage());
|
||||||
EasyRetryLog.LOCAL.info("Easy-Retry client is preparing to start... v{}", EasyRetryVersion.getVersion());
|
EasyRetryLog.LOCAL.info("Easy-Retry client is preparing to start... v{}", EasyRetryVersion.getVersion());
|
||||||
SpringContext.CONTEXT.publishEvent(new EasyRetryStartingEvent());
|
SpringContext.getContext().publishEvent(new EasyRetryStartingEvent());
|
||||||
lifecycleList.forEach(Lifecycle::start);
|
lifecycleList.forEach(Lifecycle::start);
|
||||||
SpringContext.CONTEXT.publishEvent(new EasyRetryStartedEvent());
|
SpringContext.getContext().publishEvent(new EasyRetryStartedEvent());
|
||||||
isStarted = true;
|
isStarted = true;
|
||||||
EasyRetryLog.LOCAL.info("Easy-Retry client started successfully v{}", EasyRetryVersion.getVersion());
|
EasyRetryLog.LOCAL.info("Easy-Retry client started successfully v{}", EasyRetryVersion.getVersion());
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ public class NettyChannel {
|
|||||||
* @return port
|
* @return port
|
||||||
*/
|
*/
|
||||||
public static int getServerPort() {
|
public static int getServerPort() {
|
||||||
EasyRetryProperties easyRetryProperties = SpringContext.CONTEXT.getBean(EasyRetryProperties.class);
|
EasyRetryProperties easyRetryProperties = SpringContext.getContext().getBean(EasyRetryProperties.class);
|
||||||
EasyRetryProperties.ServerConfig serverConfig = easyRetryProperties.getServer();
|
EasyRetryProperties.ServerConfig serverConfig = easyRetryProperties.getServer();
|
||||||
|
|
||||||
String port = System.getProperty(EASY_RETRY_SERVER_PORT);
|
String port = System.getProperty(EASY_RETRY_SERVER_PORT);
|
||||||
@ -86,7 +86,7 @@ public class NettyChannel {
|
|||||||
* @return host
|
* @return host
|
||||||
*/
|
*/
|
||||||
public static String getServerHost() {
|
public static String getServerHost() {
|
||||||
EasyRetryProperties easyRetryProperties = SpringContext.CONTEXT.getBean(EasyRetryProperties.class);
|
EasyRetryProperties easyRetryProperties = SpringContext.getBean(EasyRetryProperties.class);
|
||||||
EasyRetryProperties.ServerConfig serverConfig = easyRetryProperties.getServer();
|
EasyRetryProperties.ServerConfig serverConfig = easyRetryProperties.getServer();
|
||||||
|
|
||||||
String host = System.getProperty(EASY_RETRY_SERVER_HOST);
|
String host = System.getProperty(EASY_RETRY_SERVER_HOST);
|
||||||
@ -103,7 +103,7 @@ public class NettyChannel {
|
|||||||
* @return 客户端IP
|
* @return 客户端IP
|
||||||
*/
|
*/
|
||||||
public static String getClientHost() {
|
public static String getClientHost() {
|
||||||
EasyRetryProperties easyRetryProperties = SpringContext.CONTEXT.getBean(EasyRetryProperties.class);
|
EasyRetryProperties easyRetryProperties = SpringContext.getBean(EasyRetryProperties.class);
|
||||||
|
|
||||||
String host = easyRetryProperties.getHost();
|
String host = easyRetryProperties.getHost();
|
||||||
// 获取客户端指定的IP地址
|
// 获取客户端指定的IP地址
|
||||||
@ -120,8 +120,8 @@ public class NettyChannel {
|
|||||||
* @return port 端口
|
* @return port 端口
|
||||||
*/
|
*/
|
||||||
public static Integer getClientPort() {
|
public static Integer getClientPort() {
|
||||||
EasyRetryProperties easyRetryProperties = SpringContext.CONTEXT.getBean(EasyRetryProperties.class);
|
EasyRetryProperties easyRetryProperties = SpringContext.getBean(EasyRetryProperties.class);
|
||||||
ServerProperties serverProperties = SpringContext.CONTEXT.getBean(ServerProperties.class);
|
ServerProperties serverProperties = SpringContext.getBean(ServerProperties.class);
|
||||||
|
|
||||||
Integer port = easyRetryProperties.getPort();
|
Integer port = easyRetryProperties.getPort();
|
||||||
// 获取客户端指定的端口
|
// 获取客户端指定的端口
|
||||||
@ -156,8 +156,8 @@ public class NettyChannel {
|
|||||||
FullHttpRequest request = new DefaultFullHttpRequest(
|
FullHttpRequest request = new DefaultFullHttpRequest(
|
||||||
HttpVersion.HTTP_1_1, method, url, Unpooled.wrappedBuffer(body.getBytes(StandardCharsets.UTF_8)));
|
HttpVersion.HTTP_1_1, method, url, Unpooled.wrappedBuffer(body.getBytes(StandardCharsets.UTF_8)));
|
||||||
|
|
||||||
ServerProperties serverProperties = SpringContext.CONTEXT.getBean(ServerProperties.class);
|
ServerProperties serverProperties = SpringContext.getBean(ServerProperties.class);
|
||||||
EasyRetryProperties easyRetryProperties = SpringContext.CONTEXT.getBean(EasyRetryProperties.class);
|
EasyRetryProperties easyRetryProperties = SpringContext.getBean(EasyRetryProperties.class);
|
||||||
|
|
||||||
// server配置不能为空
|
// server配置不能为空
|
||||||
EasyRetryProperties.ServerConfig serverConfig = easyRetryProperties.getServer();
|
EasyRetryProperties.ServerConfig serverConfig = easyRetryProperties.getServer();
|
||||||
|
@ -67,7 +67,7 @@ public class NettyHttpClientHandler extends SimpleChannelInboundHandler<FullHttp
|
|||||||
ctx.channel().eventLoop().schedule(() -> {
|
ctx.channel().eventLoop().schedule(() -> {
|
||||||
try {
|
try {
|
||||||
// 抛出重连事件
|
// 抛出重连事件
|
||||||
SpringContext.CONTEXT.publishEvent(new ChannelReconnectEvent());
|
SpringContext.getContext().publishEvent(new ChannelReconnectEvent());
|
||||||
nettyHttpConnectClient.reconnect();
|
nettyHttpConnectClient.reconnect();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
EasyRetryLog.LOCAL.error("reconnect error ", e);
|
EasyRetryLog.LOCAL.error("reconnect error ", e);
|
||||||
|
@ -112,7 +112,7 @@ public class ReportListener implements Listener<RetryTaskDTO> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
EasyRetryProperties properties = SpringContext.CONTEXT.getBean(EasyRetryProperties.class);
|
EasyRetryProperties properties = SpringContext.getBean(EasyRetryProperties.class);
|
||||||
AlarmContext context = AlarmContext.build()
|
AlarmContext context = AlarmContext.build()
|
||||||
.text(reportErrorTextMessageFormatter,
|
.text(reportErrorTextMessageFormatter,
|
||||||
EnvironmentUtils.getActiveProfile(),
|
EnvironmentUtils.getActiveProfile(),
|
||||||
|
Loading…
Reference in New Issue
Block a user