Skip to content

[Bug] mqadmin exportMetadata exits without writing a file in broker-only mode #11613

Done

Description

@liataynat

Runtime platform environment

Windows x64 with one local NameServer and Broker.

RocketMQ version

RocketMQ 5.5.1. Reproduced against develop at 74c2a8e80a5f5ce367ba06daa19fcc187e3416c4. The export command is unchanged at b2fe3266f32e20ec3ff35b57507f52f6cb6cd33c.

JDK Version

OpenJDK 17.

Describe the Bug

mqadmin exportMetadata -b <broker> accepts a broker address and does not require -t or -g. With neither filter set, the command exits with code 0 and leaves the output directory empty. An automated export can therefore report success without a metadata file.

Steps to Reproduce

  1. Start a local NameServer and Broker, and create a user topic and subscription group.
  2. Run the following command against the Broker, using an empty output directory:
sh bin/mqadmin exportMetadata -n 127.0.0.1:9876 -b 127.0.0.1:10911 -f ./metadata-export
  1. Check the exit code and output directory.

What Did You Expect to See?

metadata.json containing the topic and subscription group tables, consistent with the default when exporting by cluster.

What Did You See Instead?

The command exited with code 0. The output directory stayed empty.

Activity

  1. MrKen20 commented on Nov 25, 2026

    @MrKen20
    Contributor

    Could the broker-only regression test in #11614 also cover a broker that returns no user topics or subscription groups? I'd expect it to still write metadata.json with topicConfigTable and subscriptionGroupTable both set to {}. That would distinguish a successful empty export from the command writing nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions