Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions consumer/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -892,8 +892,7 @@ func (dc *defaultConsumer) pullInner(ctx context.Context, queue *primitive.Messa
}

// TODO: add computPullFromWhichFilterServer

return dc.client.PullMessage(context.Background(), brokerResult.BrokerAddr, pullRequest)
return dc.client.PullMessage(ctx, brokerResult.BrokerAddr, pullRequest)
}

func (dc *defaultConsumer) processPullResult(mq *primitive.MessageQueue, result *primitive.PullResult, data *internal.SubscriptionData) {
Expand Down
8 changes: 6 additions & 2 deletions internal/remote/future.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ package remote

import (
"context"
"github.com/apache/rocketmq-client-go/v2/errors"
"errors"
e2 "github.com/apache/rocketmq-client-go/v2/errors"
"sync"
)

Expand Down Expand Up @@ -61,7 +62,10 @@ func (r *ResponseFuture) waitResponse() (*RemotingCommand, error) {
case <-r.Done:
cmd, err = r.ResponseCommand, r.Err
case <-r.ctx.Done():
err = errors.ErrRequestTimeout
err = r.ctx.Err()
if errors.Is(err, context.DeadlineExceeded) {
err = e2.ErrRequestTimeout
}
r.Err = err
}
return cmd, err
Expand Down