Skip to content
This repository has been archived by the owner on Sep 15, 2023. It is now read-only.

Commit

Permalink
Merge pull request #167 from askuy/feature/fixbugreadmessage
Browse files Browse the repository at this point in the history
fix read message nil ctx bug
  • Loading branch information
askuy authored Dec 15, 2021
2 parents cd620c9 + 72814e0 commit 4ad98a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ekafka/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ func (r *Consumer) ReadLag(ctx context.Context) (lag int64, err error) {

func (r *Consumer) ReadMessage(ctx context.Context) (msg Message, ctxOutput context.Context, err error) {
err = r.processor(func(ctx context.Context, msgs Messages, c *cmd) error {
msg, err = r.r.ReadMessage(ctxOutput)
msg, err = r.r.ReadMessage(ctx)
// 在后面才解析了header
ctxOutput = r.getCtx(ctx, msg)
logCmd(r.logMode, c, "ReadMessage", cmdWithRes(msg), cmdWithMsg(msg))
return err
Expand Down

0 comments on commit 4ad98a8

Please sign in to comment.