Files
tencent-im-util/src/main/java/com/imutil/service/DispatchService.java
T
yixiongandClaude d22fdcfaad feat: 初始化腾讯IM分发工具骨架,含回调分发链路与历史消息补拉
- 应用骨架: Solon + MyBatis-Plus + PostgreSQL + Redis + Sa-Token
- 核心链路: 回调网关 → 消息落库(幂等) → 分发队列(FOR UPDATE SKIP LOCKED) → worker消费/重试/死信
- 多租户隔离: 前缀法账号映射, 所有业务表带 tenant_id
- 管理后台: FreeMarker 渲染, 租户/授权/队列/用量管理页面
- 历史消息补拉: 水位线驱动, getRoamMsg/getGroupMsg 增量拉取, 兜底回调丢失
- msg_key 统一算法(回调/补拉共享, 跨路径去重)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-08 20:28:32 +08:00

36 lines
870 B
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package com.imutil.service;
import com.imutil.entity.DistQueue;
import java.util.List;
/**
* 回调分发服务
* <p>
* 从 dist_queue 抢占待分发记录,HTTP 转发业务系统,按回执更新状态。
*
* @author imutil
*/
public interface DispatchService {
/**
* 抢占一批 pending 记录置为 processing(事务内 FOR UPDATE SKIP LOCKED + lock
*
* @param workerName 工作线程标识
* @return 抢占到的记录列表
*/
List<DistQueue> fetchAndLock(String workerName);
/**
* 分发单条记录:HTTP 转发 → 回执成功 markDone / 失败重试或死信
*/
void dispatch(DistQueue task, String workerName);
/**
* 巡检:重置超时未回执的 processing 回到 pending(工作线程宕机恢复)
*
* @return 重置条数
*/
int recoverStuck();
}