Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: drop message if reconsumeTimes > maxReconsumeTimes #72

Merged
merged 1 commit into from
Apr 12, 2019

Conversation

gxcsoccer
Copy link
Contributor

@gxcsoccer gxcsoccer commented Apr 11, 2019

sendMessageBack 的时候有一个 maxReconsumeTimes 但是貌似没作用,所以现在本地自己判断下

@codecov
Copy link

codecov bot commented Apr 11, 2019

Codecov Report

Merging #72 into master will increase coverage by 0.06%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #72      +/-   ##
==========================================
+ Coverage   91.55%   91.62%   +0.06%     
==========================================
  Files          35       35              
  Lines        1812     1815       +3     
==========================================
+ Hits         1659     1663       +4     
+ Misses        153      152       -1
Impacted Files Coverage Δ
lib/consumer/mq_push_consumer.js 93.37% <100%> (+0.63%) ⬆️
lib/mq_client.js 88.27% <0%> (-0.35%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a44d4d0...0b8ea4b. Read the comment docs.

@gxcsoccer gxcsoccer merged commit 8ef9502 into master Apr 12, 2019
@gxcsoccer gxcsoccer deleted the fix-maxReconsumeTimes branch April 12, 2019 01:52
@gxcsoccer
Copy link
Contributor Author

3.5.1

@denghongcai
Copy link
Collaborator

根据 reconsumeTimes > maxReconsumeTimes 是服务端自己投递到死信队列去的。本地丢了会丢消息的吧。

@gxcsoccer
Copy link
Contributor Author

@denghongcai 现在实际发现超过 maxReconsumeTimes 后,还是会不断收到消息

语雀昨天出了一个问题,消息一直处理不成功,就会一种重试,重试了 17000+ 次

@denghongcai
Copy link
Collaborator

日志里有出现 sendMessageBack() occurred an exception, 这种错误吗?

@dead-horse
Copy link
Member

很神奇的是,今天再重试的时候,就正常了,是按照间隔在重试的。

现在这个场景,也是只有当 MQ server 抽风,推送超过 maxReconsumeTimes 才会丢弃吧?

@denghongcai
Copy link
Collaborator

之前理论上是正常的,只是 config 里配 maxReconsumeTimes 没有生效,所以消息都会重试 16次,我刚提了个 PR 解决 #73

�代码逻辑里应该是只有服务端抽风才会本地无限重试

很神奇的是,今天再重试的时候,就正常了,是按照间隔在重试的。

现在这个场景,也是只有当 MQ server 抽风,推送超过 maxReconsumeTimes 才会丢弃吧?

本地丢的话是真丢,正常应该是超过 maxReconsumeTimes 之后 broker 放到死信队列去,这样就起码还能查到。

@gxcsoccer
Copy link
Contributor Author

日志里有出现 sendMessageBack() occurred an exception, 这种错误吗?

没有 @denghongcai

@gxcsoccer
Copy link
Contributor Author

gxcsoccer commented Apr 12, 2019

之前理论上是正常的,只是 config 里配 maxReconsumeTimes 没有生效,所以消息都会重试 16次,我刚提了个 PR 解决 #73

你这个修复,和本地的保护没有冲突,如果服务端正常的话,是不会走到本地的保护逻辑里的 @denghongcai

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants