Skip to content

issue: the ctx not work for consumer.PullFrom method #1131

@zl03jsj

Description

@zl03jsj

The context not work in consumer.PullFrom method:

	c, err := consumer2.NewPullConsumer(
		consumer2.WithNameServer([]string{cfg.NameSvr}),
		consumer2.WithGroupName(consumerGroupName),
		consumer2.WithConsumeFromWhere(consumer2.ConsumeFromLastOffset),
		consumer2.WithConsumerOrder(true),
		consumer2.WithRetry(1),
	)
	ctx, _ = context.WithTimeout(context.Background(), time.Second)

	result, err := c.PullFrom(ctx, mq, offset, maxPullCount)

even if the ctx is timeout, or was canceled(if message queue have no new message) manually, it will still block for 30 seconds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions