{"id":19297580,"url":"https://github.com/limen/tmq","last_synced_at":"2026-01-23T15:44:00.467Z","repository":{"id":41008507,"uuid":"258946536","full_name":"limen/tmq","owner":"limen","description":"Timing Message Queue","archived":false,"fork":false,"pushed_at":"2022-06-21T03:26:45.000Z","size":19,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-24T01:47:08.952Z","etag":null,"topics":["java","queue","schedule","timing"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/limen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-26T05:22:58.000Z","updated_at":"2023-07-25T07:39:21.000Z","dependencies_parsed_at":"2022-09-26T22:20:49.008Z","dependency_job_id":null,"html_url":"https://github.com/limen/tmq","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/limen/tmq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limen%2Ftmq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limen%2Ftmq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limen%2Ftmq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limen%2Ftmq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/limen","download_url":"https://codeload.github.com/limen/tmq/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limen%2Ftmq/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28694832,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T14:15:13.573Z","status":"ssl_error","status_checked_at":"2026-01-23T14:09:05.534Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","queue","schedule","timing"],"created_at":"2024-11-09T23:05:22.747Z","updated_at":"2026-01-23T15:44:00.446Z","avatar_url":"https://github.com/limen.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# TMQ: Timing Message Queue\n\n定时消息队列\n\n介绍 [TMQ:定时消息队列](https://blog.csdn.net/u010205879/article/details/106094316)\n\n## API\n\n### 投递消息\n\n```\npush(MessageInterface msg)\n```\n\n### 拉取消息\n```\npull(Date t)\n```\n\n### 查询消息\n```\npoll(String msgId)\n```\n\n### 获取分片大小\n```\nsize(Date t)\n```\n\n### 更新消息\n```\nconsumed(MessageInterface msg)\n```\n\n## 开始使用\n\n### 准备基础环境\n\nMySQL连接\n\n```\njdbc:mysql://127.0.0.1:3306/mydemo\n```\n\nRedis连接\n\n```\nlocalhost:6379\n```\n\n### 创建数据表\n\n```\nCREATE TABLE tmq_queue (\n  id INT NOT NULL AUTO_INCREMENT,\n  queue_name VARCHAR(64) NOT NULL COMMENT '队列名称',\n  msg_id VARCHAR(24) NOT NULL COMMENT '消息ID',\n  body VARCHAR(1024) NOT NULL COMMENT '消息体',\n  schedule DATETIME NOT NULL COMMENT '投递时间',\n  status TINYINT NOT NULL COMMENT '消息状态',\n  receive_at DATETIME NOT NULL COMMENT '接收时间',\n  consume_at DATETIME COMMENT '消费时间',\n  PRIMARY KEY (id),\n  UNIQUE KEY idx_msg_id (msg_id)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;\n```\n\n### 测试\n\n见 com.limengxiang.tmq.TimingMessageQueueTest\n\n### 查看数据\n\nMySQL\n\n```\n\u003e SELECT * FROM tmq_queue;\n```\n\nRedis\n\n```\n\u003e keys *:slice:*\n\n\u003e lrange {slice key} 0 -1\n```\n\n## 消息ID生成算法\n\n参考 [xid](https://github.com/rs/xid)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flimen%2Ftmq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flimen%2Ftmq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flimen%2Ftmq/lists"}