Skip to content

Commit

Permalink
fix(retry): can not consume the messages in the retry topic (#437)
Browse files Browse the repository at this point in the history
fix(retry): can not consume the messages in the retry topic (#437)
  • Loading branch information
iqinning authored Mar 3, 2020
1 parent 2af5495 commit 2c78dae
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions consumer/push_consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"fmt"
"math"
"strconv"
"strings"
"sync"
"sync/atomic"
"time"
Expand Down Expand Up @@ -803,6 +804,12 @@ func (pc *pushConsumer) consumeInner(ctx context.Context, subMsgs []*primitive.M
}

f, exist := pc.consumeFunc.Contains(subMsgs[0].Topic)

// fix lost retry message
if !exist && strings.HasPrefix(subMsgs[0].Topic, internal.RetryGroupTopicPrefix) {
f, exist = pc.consumeFunc.Contains(subMsgs[0].GetProperty(primitive.PropertyRetryTopic))
}

if !exist {
return ConsumeRetryLater, fmt.Errorf("the consume callback missing for topic: %s", subMsgs[0].Topic)
}
Expand Down

0 comments on commit 2c78dae

Please sign in to comment.