Skip to content

Commit 1d6ffc0

Browse files
larryanzhongalex
andauthored
fix(pubsub/pstest): message ordering issue (#11603)
* fix: fix message ordering issue * fix: remove script test --------- Co-authored-by: Alex Hong <9397363+hongalex@users.noreply.github.com>
1 parent 2efca83 commit 1d6ffc0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pubsub/pstest/fake.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,7 @@ func orderMsgs(msgs map[string]*message, enableMessageOrdering bool) map[string]
11661166
if orderingKey == "" {
11671167
orderingKey = id
11681168
}
1169-
if val, ok := orderingKeyMap[orderingKey]; !ok || m.proto.Message.PublishTime.AsTime().Before(val.m.proto.Message.PublishTime.AsTime()) {
1169+
if val, ok := orderingKeyMap[orderingKey]; !ok || m.publishTime.Before(val.m.publishTime) {
11701170
orderingKeyMap[orderingKey] = msg{m: m, id: id}
11711171
}
11721172
}

0 commit comments

Comments
 (0)