You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "zl03jsj (via GitHub)" <gi...@apache.org> on 2024/03/08 11:17:52 UTC

[I] issue: the `ctx` won't work for consumer.PullFrom method [rocketmq-client-go]

zl03jsj opened a new issue, #1131:
URL: https://github.com/apache/rocketmq-client-go/issues/1131

   The context not work in `consumer.PullFrom` method:
   ```go
   	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, c.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.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org