Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用spring-cloud-stream-binder-rocketmq如何设置多线程消费参数 #2442

Closed
AI1186780944 opened this issue Mar 7, 2022 · 1 comment
Labels
area/rocketmq waiting-for-feedback Waiting for user feedback

Comments

@AI1186780944
Copy link

未在配置相关中找到可以设置consumeThreadMax和consumeThreadMin这两个参数的地方。我这边需要使用并行多线程消费消息,请问该如何处理

@DanielLiu1123
Copy link
Collaborator

DanielLiu1123 commented Mar 8, 2022

配置该属性 org.springframework.cloud.stream.binder.ConsumerProperties#concurrency,会把 consumeThreadMaxconsumeThreadMin 都设置为指定值

spring.cloud.stream.bindings.processor-in-0.consumer.concurrency=10

如果想要更灵活地配置 consumeThreadMaxconsumeThreadMin,可以自己创建 DefaultMQPushConsumer

DefaultMQPushConsumer consumer = new DefaultMQPushConsumer(...);
consumer.setConsumeThreadMin(2);
consumer.setConsumeThreadMax(10);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rocketmq waiting-for-feedback Waiting for user feedback
Projects
None yet
Development

No branches or pull requests

2 participants