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

Push consumer has a logic error in func resetRetryAndNamespace #970

Closed
humkum opened this issue Dec 13, 2022 · 0 comments · Fixed by #971
Closed

Push consumer has a logic error in func resetRetryAndNamespace #970

humkum opened this issue Dec 13, 2022 · 0 comments · Fixed by #971

Comments

@humkum
Copy link
Contributor

humkum commented Dec 13, 2022

BUG REPORT

  1. Please describe the issue you observed:
    • What did you do (The steps to reproduce)?
      When consume failed, set return type as ConsumeRetryLater, the message would just re-consumed only one time.
      I found that when consume retry message, there is a logic error in reset message's topic as follows:
func (pc *pushConsumer) resetRetryAndNamespace(subMsgs []*primitive.MessageExt) {
	groupTopic := internal.RetryGroupTopicPrefix + pc.consumerGroup
	beginTime := time.Now()
	for idx := range subMsgs {
		msg := subMsgs[idx]
		retryTopic := msg.GetProperty(primitive.PropertyRetryTopic)
		if retryTopic == "" && groupTopic == msg.Topic {
			msg.Topic = retryTopic
		}
		subMsgs[idx].WithProperty(primitive.PropertyConsumeStartTime, strconv.FormatInt(
			beginTime.UnixNano()/int64(time.Millisecond), 10))
	}
}

which should be retryTopic != "" && groupTopic == msg.Topic

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 a pull request may close this issue.

1 participant