Skip to content

Commit

Permalink
Merge pull request #171 from guoming0000/feature/2024-07-03/fix-two-i…
Browse files Browse the repository at this point in the history
…nstance-panic

fix two instance panic by trace
  • Loading branch information
luduoxin authored Jul 3, 2024
2 parents 9160bd7 + b2f5147 commit c2e1c36
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions mq/aliyunmq/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
// NewConsumer 初始化消费者
func NewConsumer(configName, groupID string, option ...consumer.Option) rocketmq.PushConsumer {
conf := initConfig(configName)
access := primitive.Cloud
if conf.IsLocal {
access = primitive.Local
}
//access := primitive.Cloud
//if conf.IsLocal {
// access = primitive.Local
//}
consumerOption := []consumer.Option{
consumer.WithGroupName(groupID),
consumer.WithNsResolver(primitive.NewPassthroughResolver([]string{conf.NameServer})),
Expand All @@ -22,12 +22,12 @@ func NewConsumer(configName, groupID string, option ...consumer.Option) rocketmq
}),
consumer.WithConsumeMessageBatchMaxSize(1), // 批量获取数量 默认每次获取一条处理一条
consumer.WithNamespace(conf.Namespace),
consumer.WithTrace(&primitive.TraceConfig{
GroupName: groupID,
Access: access,
Resolver: primitive.NewPassthroughResolver(primitive.NamesrvAddr{conf.NameServer}),
Credentials: primitive.Credentials{AccessKey: conf.AccessKey, SecretKey: conf.SecretKey},
}),
//consumer.WithTrace(&primitive.TraceConfig{
// GroupName: groupID,
// Access: access,
// Resolver: primitive.NewPassthroughResolver(primitive.NamesrvAddr{conf.NameServer}),
// Credentials: primitive.Credentials{AccessKey: conf.AccessKey, SecretKey: conf.SecretKey},
//}),
}

// 支持自定义配置
Expand Down

0 comments on commit c2e1c36

Please sign in to comment.