Open CodingOX opened 8 months ago
rocketmq currently only supports sequential consumption for a single queue
Need to set consumer group as order consumption mode
Need to set consumer group as order consumption mode
From the doc : https://rocketmq.apache.org/zh/docs/featureBehavior/03fifomessage and souce code , I can't find the api for order consumption mode? Can you give me more help?
Need to set consumer group as order consumption mode
Need to set consumer group as order consumption mode
You mean that if using RocketMQ version 5 and requiring a first-in-first-out (FIFO) ordering queue, I must configure the topic with only one message queue?
Configure your consumer group as order with "-o" option.
./mqadmin updateSubGroup -c DefaultCluster -n 192.168.10.233:9876 -g OrderConsumerGroupV3 -o true
Configure your consumer group as order with "-o" option.
./mqadmin updateSubGroup -c DefaultCluster -n 192.168.10.233:9876 -g OrderConsumerGroupV3 -o true
This is my original shell that from official document. I have used -o true
for the topic creation.
./mqadmin updateTopic -c DefaultCluster -t FIFOTopic -o true -n 192.168.10.233:9876 -a +message.type=FIFO
So this cause of the problem can be ruled out.
I found the same problem. I use the Rust client. First I thought it was a client bug. But later I use grpcurl to send the same messages and I got the same result. The Rust client surpport batch send. I only found this problem in batch send api. When use batch send. not only the order is wrong, also the keys are wrong, all the messages in the same batch will have the key of the first message of the batch. and in the batch send scenario, the message are put in different queue randomly.
Before Creating the Bug Report
[X] I found a bug, not just asking a question, which should be created in GitHub Discussions.
[X] I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.
[X] I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.
Runtime platform environment
Unbuntu 20.04
RocketMQ version
RocketMQ 5.2
JDK Version
JDK 21
Describe the Bug
When attempting to consume messages in order using the RocketMQ 5 client with a 2 master no any slaves, it is observed that the consumer is unable to consume messages sequentially.
Steps to Reproduce
Create FIFO topic
Producer Code, Write in Kotlin
OrderedGroup-1
.Consumer Code
ConcurrentLinkedQueue
to store received messages temporarily for logging purposes.FIFOTopic
with tagtag-2
.cq.joinToString("\n")
.What Did You Expect to See?
Te messages should be consumed in the order they were sent. However, the consumer is not able to achieve this expected behavior.
What Did You See Instead?
Messages are not consumed in the order in which they were sent?
Additional Context
From the dashboard, we can see the message store in the same message queue.
And From the http api
/message/queryMessageByTopicAndKey.query?key=xxx&topic=FIFOTopic
, we can get the message details. The message with index 6 arrived at the broker later than the message with index 5. but 6 is consume before than 5.