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.26k stars 11.7k forks source link

add import/export command and test #6972 #8676

Open carlvine500 opened 2 months ago

carlvine500 commented 2 months ago

Which Issue(s) This PR Fixes

Fixes #6971 refer failed pull request #6972

Brief Description

  1. migrate message across env: we switch our system from aws to aliyun , some message still not consumed in aws , we should migrate message from aws to aliyun ==> just use exportMessage and importMessage .
  2. fix some wrong message: after deploy some bug , the message format is not correct ==> we can exportMessage with json body --> modify message body --> importMessasge
  3. trace bug in lots of message body ==> after export message with json/text format ,we could easily search some keywords to view message detail , such as grep keyword messageFile

How Did You Test This Change?

  1. exportMessage: mock broker , fetch some messages and export to file , at the same time , show result 100% on system.out
  2. importMessage: mock broker , read a message file and send message to broker , at the same time , show result 100% on system.out

example usage

WeChatc0e14e48d1e5c6ef1ee135a5141a74bf
codecov-commenter commented 2 months ago

Codecov Report

Attention: Patch coverage is 67.56757% with 96 lines in your changes missing coverage. Please review.

Project coverage is 47.52%. Comparing base (f43d9d1) to head (1ec33a6).

Files with missing lines Patch % Lines
...mq/tools/command/message/ExportMessageCommand.java 65.88% 37 Missing and 21 partials :warning:
...mq/tools/command/message/ImportMessageCommand.java 66.97% 20 Missing and 16 partials :warning:
.../apache/rocketmq/tools/command/MQAdminStartup.java 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #8676 +/- ## ============================================== + Coverage 0 47.52% +47.52% - Complexity 0 11565 +11565 ============================================== Files 0 1279 +1279 Lines 0 89745 +89745 Branches 0 11550 +11550 ============================================== + Hits 0 42652 +42652 - Misses 0 41845 +41845 - Partials 0 5248 +5248 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.