Delayer 基于 Redis 的延迟消息队列中间件

2018-10-26 16:17:40 +08:00
 onanying

Delayer

基于 Redis 的延迟消息队列中间件,采用 Golang 开发。

参考 有赞延迟队列设计 中的部分设计,优化后实现。

项目链接: https://github.com/mixstart/delayer,有需要的朋友加 Star 哦。

应用场景

实现原理

核心特征

如何使用

delayer 分为:

服务器端

https://github.com/mixstart/delayer/releases 中下载对应平台的程序。

支持 windows、linux、mac 三种平台

然后修改配置文件 delayer.conf

[delayer]
pid = /var/run/delayer.pid      ; 单例执行, 多实例执行留空, Win 不支持
timer_interval = 1000           ; 计算间隔时间, 单位毫秒
access_log = logs/access.log    ; 存取日志
error_log = logs/error.log      ; 错误日志

[redis]
host = 127.0.0.1                ; 连接地址
port = 6379                     ; 连接端口
database = 0                    ; 数据库编号
password =                      ; 密码, 无需密码留空
max_idle = 2                    ; 最大空闲连接数
max_active = 20                 ; 最大激活连接数
idle_timeout = 3600             ; 空闲连接超时时间, 单位秒
conn_max_lifetime = 3600        ; 连接生存时间, 单位秒

查看帮助:

[root@localhost bin]# ./delayer -h
Usage: delayer [options]

Options:
-d/--daemon run in the background
-c/--configuration FILENAME -- configuration file path (searches if not given)
-h/--help -- print this usage message and exit
-v/--version -- print version number and exit

启动:

[root@localhost bin]# ./delayer
    ____       __
   / __ \___  / /___ ___  _____  _____
  / / / / _ \/ / __ `/ / / / _ \/ ___/
 / /_/ /  __/ / /_/ / /_/ /  __/ /
/_____/\___/_/\__,_/\__, /\___/_/
                   /____/
Service:		delayer
Version:		1.0.1
[info] 2018/10/19 11:24:24 Service started successfully, PID: 31023

客户端

我们提供了以下几种语言:

根据对应项目的说明使用

License

Apache License Version 2.0, http://www.apache.org/licenses/

2906 次点击
所在节点    开源软件
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/501456

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX