This is an automated email from the ASF dual-hosted git repository.
yuzhou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-client-go.git
The following commit(s) were added to refs/heads/master by this push:
new c197b50 [ISSUE #931] fix filter message (#932)
c197b50 is described below
commit c197b50c31765f76eaefda64c81138c9b4ccc321
Author: 0daypwn <[email protected]>
AuthorDate: Mon Oct 31 19:39:48 2022 +0800
[ISSUE #931] fix filter message (#932)
Co-authored-by: wuxb02 <[email protected]>
---
consumer/consumer.go | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/consumer/consumer.go b/consumer/consumer.go
index b0f26dd..15100cd 100644
--- a/consumer/consumer.go
+++ b/consumer/consumer.go
@@ -20,7 +20,6 @@ package consumer
import (
"context"
"fmt"
- "github.com/apache/rocketmq-client-go/v2/hooks"
"sort"
"strconv"
"strings"
@@ -28,11 +27,11 @@ import (
"sync/atomic"
"time"
- "github.com/apache/rocketmq-client-go/v2/errors"
-
jsoniter "github.com/json-iterator/go"
"github.com/tidwall/gjson"
+ "github.com/apache/rocketmq-client-go/v2/errors"
+ "github.com/apache/rocketmq-client-go/v2/hooks"
"github.com/apache/rocketmq-client-go/v2/internal"
"github.com/apache/rocketmq-client-go/v2/internal/remote"
"github.com/apache/rocketmq-client-go/v2/internal/utils"
@@ -881,7 +880,7 @@ func (dc *defaultConsumer) processPullResult(mq
*primitive.MessageQueue, result
// filter message according to tags
msgListFilterAgain := msgs
- if data.Tags.Len() > 0 && data.ClassFilterMode {
+ if data.Tags.Len() > 0 && !data.ClassFilterMode {
msgListFilterAgain = make([]*primitive.MessageExt, 0)
for _, msg := range msgs {
_, exist := data.Tags.Contains(msg.GetTags())