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

rocketmq return SEND_OK,but the message is lose #2066

Closed zhgdbut closed 4 years ago

zhgdbut commented 4 years ago

use this method : this.sendDefaultImpl(msg, CommunicationMode.SYNC, null, timeout); in org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl#sendDefaultImpl

I had send message success because it returned SEND_OK and msgId, but i can not found the message .

lebron374 commented 4 years ago

you can print the return result and print messageKey,then you can use mqadmin to query the message to check。

zhgdbut commented 4 years ago

I had print return result , and use msgId query in the mqadmin, but nothing found! This kind of thing only happens once or twice。

lizhanhui commented 4 years ago

zhgdbut,

Here is the checklist, which might be helpful to you.

  1. RocketMQ supports synchronous disk flush and asynchronous disk flush strategies. If you configured to use the latter without replication, in case of a power outage/OS crash, it has chances, though very unlikely, to lose one or a few messages as you configured those broker servers to ack clients before flushing data to disk.
  2. When querying messages, RocketMQ internally queries consume queues, which are built out of commit log asynchronously. If for some reason, the building consume-queue process lags behind, you may find the sent message unavailable for a while. But your message will appear once the building catches up. Check the store.log to see if this is the case.
  3. If your broker runs out of disk, it automatically deletes the earliest data in order to keep serving, even if these old ones are never consumed.

Either case mentioned above may lead you to the conclusion that your message is 'lost'.

Zhanhui Li

On Tue, Jun 2, 2020 at 11:12 PM zhgdbut notifications@github.com wrote:

I had print return result , and use msgId query in the mqadmin, but nothing found! This kind of thing only happens once or twice。

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/apache/rocketmq/issues/2066#issuecomment-637606420, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAE4WG4BBPHTBMWOKXV7UQLRUUJFJANCNFSM4NQUIAOQ .

renfushuai commented 1 year ago

This happened to me, too. How did you solve it