All Projects → peachyy → sdmq

peachyy / sdmq

Licence: Apache-2.0 license
is a simple delay message queue, based on redis and kotlin

Programming Languages

java
68154 projects - #9 most used programming language
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to sdmq

Amqp Tools
The amqp tools such as delay strategies and so on.
Stars: ✭ 125 (+303.23%)
Mutual labels:  queue, delay
Swiftqueue
Job Scheduler for IOS with Concurrent run, failure/retry, persistence, repeat, delay and more
Stars: ✭ 276 (+790.32%)
Mutual labels:  queue, delay
node-svmq
Native System V message queues in Node.js
Stars: ✭ 16 (-48.39%)
Mutual labels:  queue, mq
Delayer
🌶️ 基于 Redis 的延迟队列中间件,采用 Golang 开发,支持 PHP、Golang 等多种语言客户端
Stars: ✭ 145 (+367.74%)
Mutual labels:  queue, delay
joobq
JoobQ is a fast, efficient asynchronous reliable job queue and job scheduler library processing. Jobs are submitted to a job queue, where they reside until they are able to be scheduled to run in a computing environment.
Stars: ✭ 26 (-16.13%)
Mutual labels:  queue
muton
A feature toggle tool with support for feature throttling and multivariance testing.
Stars: ✭ 15 (-51.61%)
Mutual labels:  bucket
deque
JavaScript implementation of a double-ended queue
Stars: ✭ 17 (-45.16%)
Mutual labels:  queue
rsmq-promise
Promise interface for RSMQ
Stars: ✭ 28 (-9.68%)
Mutual labels:  queue
wolfmq
Simple message broker for Erlang applications
Stars: ✭ 13 (-58.06%)
Mutual labels:  mq
serverless-s3bucket-sync
Serverless Plugin to sync local folders with an S3 bucket
Stars: ✭ 24 (-22.58%)
Mutual labels:  bucket
pan
Pan is a high performance mq proxy,support kafka,rabbit-mq,rocketmq,nsq and other mq
Stars: ✭ 27 (-12.9%)
Mutual labels:  mq
Melodrumatic
Audio plugin that lets you use MIDI to pitch-shift via delay to turn unpitched audio into melodies
Stars: ✭ 26 (-16.13%)
Mutual labels:  delay
Algorithms
Data Structures & Algorithms. Includes solutions for Cracking the Coding Interview 6th Edition
Stars: ✭ 89 (+187.1%)
Mutual labels:  queue
fastrq
Queue, Stack and Priority Queue built on Redis.
Stars: ✭ 15 (-51.61%)
Mutual labels:  queue
DEPRECATED-data-structures
A collection of powerful data structures
Stars: ✭ 2,648 (+8441.94%)
Mutual labels:  queue
resque-heroku-signals
Patch resque to be compatible with Heroku process signaling
Stars: ✭ 22 (-29.03%)
Mutual labels:  queue
taskqueues.com
A list of distributed task queueing software.
Stars: ✭ 25 (-19.35%)
Mutual labels:  queue
react-on-time
Renderless composable ⏰timers and ⏱intervals
Stars: ✭ 27 (-12.9%)
Mutual labels:  delay
spinach
Modern Redis task queue for Python 3
Stars: ✭ 46 (+48.39%)
Mutual labels:  queue
sleepover
💤 Sleep, snooze & step methods
Stars: ✭ 13 (-58.06%)
Mutual labels:  delay

sdmq Build Status Coverage Status Gitter

is a simple delay message queue, based on redis and kotlin

设计 https://www.cnblogs.com/peachyy/p/7398430.html

一个简单、稳定、可扩展的延迟消息队列

运行模式

  • 支持 master,slave (HA)需要配置sdmq.registry.serverList zk集群地址列表
  • 支持 cluster 会涉及到分布式锁竞争 效果不是很明显 分布式锁采用redissetNx实现
  • StandAlone

推荐使用master slave的模式

Usage

消息体

以JSON数据格式参数 目前只提供了http协议

  • body 业务消息体
  • delay 延时毫秒 距createTime的间隔毫秒数
  • id 任务ID 系统自动生成 任务创建成功返回
  • status 状态 默认不填写
  • topic 标题
  • subtopic 保留字段
  • ttl 保留字段
  • createTime 创建任务时间 非必填 系统默认

添加任务

/push  
  POST application/json

{"body":"{ffff}","delay":56600,"id":"20","status":0,"topic":"ces","subtopic":"",ttl":12}

删除任务

删除任务 需要记录一个JobId

/delete?jobId=xxx
   GET

恢复单个任务

用于任务错乱 脑裂情况 根据日志恢复任务

/reStoreJob?JobId=xxx
   GET

恢复所有未完成的任务

根据日志恢复任务

/reStore?expire=true
   GET

参数expire 表示是否需要恢复已过期还未执行的数据

清空队列数据

根据日志中未完成的数据清空队列中全部数据

清空之后 会删除缓存中的所有任务

/clearAll
   GET

客户端获取队列方式

目前默认实现了rocketmq的推送方式。暂时就不用自己去实现推拉数据了。直接强依赖MQ。

消息体中消息与rocketmq消息字段对应关系
sdmq rocketMQ 备注
topic topic
subtopic tag
body 消息内容 消息内容

后期优化

  • 分区(buck)支持动态设置
  • redis与数据库数据一致性的问题 (重要
  • 实现自己的推拉机制
  • 支持可切换实现方式 当前强依赖redis 只有这么1个实现
  • 支持Web控制台管理队列
  • 实现消息消费TTL机制

定位是后期会改为基于kotlin java太多麻烦事了

测试

需要配置好数据库地址和redis的地址 如果不是单机模式 也需要配置好zookeep

运行测试类io.sdmq.FixTest添加任务到队列中

启动Bootstarp消费前面添加数据 为了方便查询效果 默认的消费方式是consoleCQ 控制台输出

更新日志

  • 2017年11月21日14:34:39 支持restful清空队列数据
  • 2018年03月19日14:26:56 支持配置消费方式 默认为jmsCQ 在不修改代码的情况下覆盖方式 -DClassName=xxxx
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].