You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "bogerv (via GitHub)" <gi...@apache.org> on 2024/04/01 11:38:47 UTC
[I] Using WithConsumeGoroutineNums in pushconsumer may not work as expected. [rocketmq-client-go]
bogerv opened a new issue, #1135:
URL: https://github.com/apache/rocketmq-client-go/issues/1135
The issue tracker is **ONLY** used for the go client (feature request of RocketMQ need to follow [RIP process](https://github.com/apache/rocketmq/wiki/RocketMQ-Improvement-Proposal)). Keep in mind, please check whether there is an existing same report before your raise a new one.
Alternately (especially if your communication is not a bug report), you can send mail to our [mailing lists](http://rocketmq.apache.org/about/contact/). We welcome any friendly suggestions, bug fixes, collaboration, and other improvements.
Please ensure that your bug report is clear and that it is complete. Otherwise, we may be unable to understand it or to reproduce it, either of which would prevent us from fixing the bug. We strongly recommend the report(bug report or feature request) could include some hints as to the following:
**BUG REPORT**
1. Please describe the issue you observed:
- What did you do (The steps to reproduce)?
Use consumer.WithConsumeGoroutineNums(1) to create push consumer, but not work
c, err = rocketmq.NewPushConsumer(
consumer.WithNameServer(config.Config.NameServers),
consumer.WithGroupName(fmt.Sprintf("%s-%s%s", group, base, quote)),
consumer.WithConsumeMessageBatchMaxSize(config.Config.ConsumeMaxSize),
consumer.WithConsumeGoroutineNums(1),
// consumer.WithNsResolver(primitive.NewPassthroughResolver([]string{"34.87.173.164:28081"})),
)
- What did you expect to see?
Only start one goroutine to proceed
- What did you see instead?
Started 8 goroutine one time
2. Please tell us about your environment:
- What is your OS?
CentOS 7
- What is your client version?
V4_5_2
- What is your RocketMQ version?
V5_1_4
3. Other information (e.g. detailed explanation, logs, related issues, suggestions on how to fix, etc):
Using poll consumer will not guarantee that this problem
--
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
Re: [I] Using WithConsumeGoroutineNums in pushconsumer may not work as expected. [rocketmq-client-go]
Posted by "bogerv (via GitHub)" <gi...@apache.org>.
bogerv commented on issue #1135:
URL: https://github.com/apache/rocketmq-client-go/issues/1135#issuecomment-2033827068
`
func OrderPersistListDealing(_accountType string, _b string, _q string) {
err := rocketmq.RMQ().Consumer(rocketmq.ConsumerGroupPersist).Subscribe(
rocketmq.GetTopicPersist(_b, _q),
consumer.MessageSelector{Type: consumer.TAG, Expression: util.FormatSymbol(_b, _q)},
func(ctx context.Context, msgs ...*primitive.MessageExt) (consumer.ConsumeResult, error) {
wg := &sync.WaitGroup{}
bulkInsertESOrder(orders, wg, &esErr)
})
}`
Inside the bulkInsertESOrder function, print logs after sleep 5 seconds. The result is that every 5 seconds, 8 logs will be printed at the same time.
The scenario is an application process that starts multiple goroutine(OrderPersistListDealing is started multiple goroutine with different _b and _q), with each goroutine using the same consumer to subscribe multiple topics, and use MessageSelector to distinguish different data.
--
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
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Using WithConsumeGoroutineNums in pushconsumer may not work as expected. [rocketmq-client-go]
Posted by "cserwen (via GitHub)" <gi...@apache.org>.
cserwen commented on issue #1135:
URL: https://github.com/apache/rocketmq-client-go/issues/1135#issuecomment-2033860392
This para only takes effect for concurrent consumption. For order consumption, each queue has one and only one coroutine to consume. @bogerv
--
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
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Using WithConsumeGoroutineNums in pushconsumer may not work as expected. [rocketmq-client-go]
Posted by "bogerv (via GitHub)" <gi...@apache.org>.
bogerv commented on issue #1135:
URL: https://github.com/apache/rocketmq-client-go/issues/1135#issuecomment-2033849433
> > ` func OrderPersistListDealing(_accountType string, _b string, _q string) { err := rocketmq.RMQ().Consumer(rocketmq.ConsumerGroupPersist).Subscribe( rocketmq.GetTopicPersist(_b, _q), consumer.MessageSelector{Type: consumer.TAG, Expression: util.FormatSymbol(_b, _q)}, func(ctx context.Context, msgs ...*primitive.MessageExt) (consumer.ConsumeResult, error) { wg := &sync.WaitGroup{} bulkInsertESOrder(orders, wg, &esErr) }) }` Inside the bulkInsertESOrder function, print logs after sleep 5 seconds. The result is that every 5 seconds, 8 logs will be printed at the same time.
> > The scenario is an application process that starts multiple goroutine(OrderPersistListDealing is started multiple goroutine with different _b and _q), with each goroutine using the same consumer to subscribe multiple topics, and use MessageSelector to distinguish different data.
>
> Cosume orderly ? Can you show the init code of rmq-consumer?
c, err = rocketmq.NewPushConsumer(
consumer.WithNameServer(config.Config.NameServers),
consumer.WithGroupName(group),
consumer.WithConsumerOrder(true),
consumer.WithConsumerModel(consumer.Clustering),
consumer.WithConsumeMessageBatchMaxSize(config.ConsumeMaxSize),
)
--
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
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Using WithConsumeGoroutineNums in pushconsumer may not work as expected. [rocketmq-client-go]
Posted by "bogerv (via GitHub)" <gi...@apache.org>.
bogerv commented on issue #1135:
URL: https://github.com/apache/rocketmq-client-go/issues/1135#issuecomment-2033901185
> This param only takes effect for concurrent consumption. For order-consumption, each queue has one and only one coroutine to consume.
So does this mean that if we need to consume bulk data in sequence, each consumer will need to subscribe to a separate topic?
--
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
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Using WithConsumeGoroutineNums in pushconsumer may not work as expected. [rocketmq-client-go]
Posted by "cserwen (via GitHub)" <gi...@apache.org>.
cserwen commented on issue #1135:
URL: https://github.com/apache/rocketmq-client-go/issues/1135#issuecomment-2033738710
How to determine that 8 coroutines for consumption are generated @bogerv
--
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
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Using WithConsumeGoroutineNums in pushconsumer may not work as expected. [rocketmq-client-go]
Posted by "cserwen (via GitHub)" <gi...@apache.org>.
cserwen commented on issue #1135:
URL: https://github.com/apache/rocketmq-client-go/issues/1135#issuecomment-2033836761
> ` func OrderPersistListDealing(_accountType string, _b string, _q string) { err := rocketmq.RMQ().Consumer(rocketmq.ConsumerGroupPersist).Subscribe( rocketmq.GetTopicPersist(_b, _q), consumer.MessageSelector{Type: consumer.TAG, Expression: util.FormatSymbol(_b, _q)}, func(ctx context.Context, msgs ...*primitive.MessageExt) (consumer.ConsumeResult, error) { wg := &sync.WaitGroup{} bulkInsertESOrder(orders, wg, &esErr) }) }` Inside the bulkInsertESOrder function, print logs after sleep 5 seconds. The result is that every 5 seconds, 8 logs will be printed at the same time.
>
> The scenario is an application process that starts multiple goroutine(OrderPersistListDealing is started multiple goroutine with different _b and _q), with each goroutine using the same consumer to subscribe multiple topics, and use MessageSelector to distinguish different data.
Cosume orderly ? Can you show the init code of rmq-consumer?
--
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
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Using WithConsumeGoroutineNums in pushconsumer may not work as expected. [rocketmq-client-go]
Posted by "bogerv (via GitHub)" <gi...@apache.org>.
bogerv closed issue #1135: Using WithConsumeGoroutineNums in pushconsumer may not work as expected.
URL: https://github.com/apache/rocketmq-client-go/issues/1135
--
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
For queries about this service, please contact Infrastructure at:
users@infra.apache.org