apache / rocketmq

Apache RocketMQ is a cloud native messaging and streaming platform, making it simple to build event-driven applications.
https://rocketmq.apache.org/
Apache License 2.0
21.19k stars 11.67k forks source link

Is rocketmq-client-java support orderly consuming? #5378

Closed daigoopautoy closed 2 years ago

daigoopautoy commented 2 years ago

I want to use rocketmq5.0 and find quickstart recommend I use org.apache.rocketmq.rocketmq-client-java for my client. Now I want to consume orderly like 4.x but I only find api org.apache.rocketmq.client.apis.consumer.PushConsumerBuilder#setMessageListener which have no choice to consume orderly.

aaron-ai commented 2 years ago

Of course.

In the new client of Apache RocketMQ, we think the FIFO/non-FIFO consumption should be an attribute of consumer group, it should not be set on each consumer, which may be inconsistent. In fact, the implementation of client will try to fetch the attributes of consumer group and determine the FIFO consumption or not automatically.

So you should mark consumer as FIFO or Non-FIFO when you create it, just try it out :)