# spring-boot-starter-rocketmq-tx **Repository Path**: jaychang/spring-boot-starter-rocketmq-tx ## Basic Information - **Project Name**: spring-boot-starter-rocketmq-tx - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-04-25 - **Last Updated**: 2025-09-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 消息表结构 ```sql CREATE TABLE `t_pending_send_msg` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `create_time` datetime NOT NULL COMMENT '创建时间', `update_time` datetime NOT NULL COMMENT '修改时间', `msg_topic` varchar(64) NOT NULL COMMENT '消息Topic', `msg_tag` varchar(32) NOT NULL COMMENT '消息Tag', `msg_key` varchar(64) NOT NULL DEFAULT '' COMMENT '消息Key', `msg_body` text NOT NULL COMMENT '消息体', `msg_id` varchar(32) DEFAULT NULL COMMENT '已发送MQ消息记录的msg_id', `send_status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否已发送:【0=待发送,1=已发送】', `send_time` datetime DEFAULT NULL COMMENT '发送时间(这个字段意思是调用发送消息方法的时间,如果是延迟消息,准确时间要参照rocketmq console 上消息的Storetime)', `retry_count` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '重试次数【最多10次】', `next_retry_time` datetime NOT NULL COMMENT '下次可进行重试发送时间', `delay_time_level` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '消息延迟发送时间级别【0表示立即发送】', PRIMARY KEY (`id`), UNIQUE KEY `uk_msg_id` (`msg_id`), KEY `idx_create_time` (`create_time`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='待发送的MQ消息记录'; CREATE TABLE `t_running_instance` ( `id` bigint(20) unsigned NOT NULL COMMENT '服务实例主键', `update_time` datetime DEFAULT NULL, `uuid` varchar(64) DEFAULT '' COMMENT '服务实例UUID', `version` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '更新版本号', PRIMARY KEY (`id`), UNIQUE KEY `uk_uuid` (`uuid`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT INTO `t_running_instance` (`id`, `update_time`, `uuid`, `version`) VALUES ('1', '2025-01-01 00:00:00', '', 0); ``` 服务启动时,乐观锁竞争,定时任务执行时,更新update_time,下次定时任务执行时判断update_time有没有超出指定时间比如30分钟,如果超出则更新服务实例UUID