Skip to content

mqtt-replay: Add CLI option to override publish topic#12

Open
scfct wants to merge 1 commit intomasterfrom
feat/customized_replay_topic
Open

mqtt-replay: Add CLI option to override publish topic#12
scfct wants to merge 1 commit intomasterfrom
feat/customized_replay_topic

Conversation

@scfct
Copy link

@scfct scfct commented Sep 22, 2025

As developers, we occasionally encounter scenarios where recorded messages under one topic hierarchy (e.g. v2x/loopback/#) need to be replayed on a different topic path (e.g. v2x/rx/#). To simplify this workflow, it’s helpful to provide a built-in way to redirect topics during playback.

This PR introduces a new CLI option for the mqtt-replay utility that allows overriding the recorded topic, enabling more flexible testing and integration with different topic structures.

Signed-off-by: iamara <iskander.amara.it@gmail.com>
@scfct scfct changed the base branch from v2 to master September 22, 2025 09:11
Copy link

@BendixBuchheister BendixBuchheister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure how much this helps, when all messages are published on the same topic tho.
Normally we record topics with wildcard subscriptions

@jbeyerstedt
Copy link
Collaborator

Have you looked into the bridging functionality of mosquitto? Because that can forward messages from one topic to another even with rewriting a topic prefix.

I think, that rewriting the recorded topic(s) can be useful feature. But replacing all recorded topics with a single one serves a very limited scope and may even be a bit dangerous. Therefore I see two possible things that can be a future feature of this application:

  • either combine it with a filter which specifies which topic (wildcard) from the recording is re-published during playback. Then you could single out a recorded topic and replace that with another one.
  • or extend the CLI option to support the MQTT bridge-topic syntax like pattern record-prefix publish-prefix to add, remove or rewrite prefixes.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants