giant-stone / gmq Goto Github PK
View Code? Open in Web Editor NEW一个支持自定义消费速率的简单消息队列 Simple, reliable, lightweight and efficient task queue in Go
License: MIT License
一个支持自定义消费速率的简单消息队列 Simple, reliable, lightweight and efficient task queue in Go
License: MIT License
Line 145 in cdab165
processedat 应该记录 handler 从队列取出的时间戳
dieat 记录 handler 放入 failed 的时间戳
err 记录 handler 的返回的 error 上下文
./gmqcli.bin -listmsg <queueName> -state failed [-limit 10 -offset 10]
options required: -state
options optional: -limit -offset
./gmqcli.bin -getmsg -i <msgId> -q <queueName>
options required: -i -q
NOTE: drop old -get option
usage
delete all related messages from queue
./gmqcli.bin -delqueue <queueName>
debug logging ProcessMsg got unknown subtype -- uri -- queue=foo id=https://foo.bar/id/123/?fmt=json elapsed=0s
可能引起原因:github.com/giant-stone/gmq v0.0.15 版本实现局限。
相同 id 入队两次,并且设置忽略去重参数 gmq.OptIgnoreUnique(true)
,
消费队列时,第一次从 pending 获取 消息 id,从 detail hash 获取消息详情,消费会成功;
第二次由于第一次成功后,清空消息详情(含 payload ),因此第二次处理时,payload 为空 ,payload 中 subtype、uri 也为空。
解决方式二选一:
一、设置去重参数;
二、消费者加个全局中间件,判断 payload 为空则丢弃此消息。
Line 83 in 687ff6e
https://github.com/giant-stone/gmq/blob/master/gmq/cmd/gmqcli/main.go#L40
cmdStatsWeekly 合并入 cmdPrintStats
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.