This is an automated email from the ASF dual-hosted git repository.
dinglei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-client-go.git
The following commit(s) were added to refs/heads/master by this push:
new 5f33f1f fix primitive.WithMethod ctx transfer (#837)
5f33f1f is described below
commit 5f33f1fc8a9fb0616cd24079dad2cbb756062668
Author: 胡同里有猫 <[email protected]>
AuthorDate: Thu Jul 21 19:22:10 2022 +0800
fix primitive.WithMethod ctx transfer (#837)
---
producer/producer.go | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/producer/producer.go b/producer/producer.go
index ef217e4..a30764d 100644
--- a/producer/producer.go
+++ b/producer/producer.go
@@ -196,7 +196,7 @@ func (p *defaultProducer) Request(ctx context.Context,
timeout time.Duration, ms
}
if p.interceptor != nil {
- primitive.WithMethod(ctx, primitive.SendAsync)
+ ctx = primitive.WithMethod(ctx, primitive.SendAsync)
return nil, p.interceptor(ctx, msg, nil, func(ctx
context.Context, req, reply interface{}) error {
return p.sendAsync(ctx, msg, f)
@@ -237,7 +237,7 @@ func (p *defaultProducer) RequestAsync(ctx context.Context,
timeout time.Duratio
var resErr error
if p.interceptor != nil {
- primitive.WithMethod(ctx, primitive.SendAsync)
+ ctx = primitive.WithMethod(ctx, primitive.SendAsync)
resErr = p.interceptor(ctx, msg, nil, func(ctx context.Context,
req, reply interface{}) error {
return p.sendAsync(ctx, msg, f)
})
@@ -260,7 +260,7 @@ func (p *defaultProducer) SendSync(ctx context.Context,
msgs ...*primitive.Messa
resp := primitive.NewSendResult()
if p.interceptor != nil {
- primitive.WithMethod(ctx, primitive.SendSync)
+ ctx = primitive.WithMethod(ctx, primitive.SendSync)
producerCtx := &primitive.ProducerCtx{
ProducerGroup: p.group,
CommunicationMode: primitive.SendSync,
@@ -331,7 +331,7 @@ func (p *defaultProducer) SendAsync(ctx context.Context, f
func(context.Context,
msg := p.encodeBatch(msgs...)
if p.interceptor != nil {
- primitive.WithMethod(ctx, primitive.SendAsync)
+ ctx = primitive.WithMethod(ctx, primitive.SendAsync)
return p.interceptor(ctx, msg, nil, func(ctx context.Context,
req, reply interface{}) error {
return p.sendAsync(ctx, msg, f)
@@ -381,7 +381,7 @@ func (p *defaultProducer) SendOneWay(ctx context.Context,
msgs ...*primitive.Mes
msg := p.encodeBatch(msgs...)
if p.interceptor != nil {
- primitive.WithMethod(ctx, primitive.SendOneway)
+ ctx = primitive.WithMethod(ctx, primitive.SendOneway)
return p.interceptor(ctx, msg, nil, func(ctx context.Context,
req, reply interface{}) error {
return p.sendOneWay(ctx, msg)
})