Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature to add a topic remapping when in bridge mode #127

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Evil2000
Copy link

@Evil2000 Evil2000 commented Jan 7, 2025

Hey guys,

I added a feature which allows topics to be remapped when publishing to and receiving from remote brokers. This allows a topic tree from the local broker to be inserted into the topic tree of the remote broker at an appropriate place.
It is similar to the remote-prefix parameter in mosquitto.

When sending messages to a remote bridge server, the topic defined in subscribe or publish can be prepended with a prefix.

The difference to mosquitto is, that only the published or subscribed remote topic is prefixed. The local topic is not changed (like local-prefix in mosquitto does).

Example 1: Publish all messages in all local topics to the remote system under topic bridge1/ and receive all messages from the remote system in topic bridge1/ in local. For instance, the local topic home/sensor1/temp becomes bridge1/home/sensor1/temp on the remote site and vice versa.

bridge {
  # ...
  topic_prefix bridge1/
  publish #
  subscribe #
}

Example 2: Publish all messages from local topic1/ to the remote system under bridge1/topic1/ and receive all messages from the remote system under bridge1/topic2/ to local topic2/.

bridge {
  # ...
  topic_prefix bridge1/
  publish topic1/#
  subscribe topic2/#
}

I would appreciate it if you have look at the new feature or maybe you like to merge it into your repo.

Kind regards.

@halfgaar
Copy link
Owner

halfgaar commented Jan 7, 2025 via email

@halfgaar
Copy link
Owner

halfgaar commented Jan 8, 2025

#81

https://github.com/halfgaar/FlashMQ/tree/WIP-bridge-prefixes

Still not rebased, byt FYI.

@halfgaar
Copy link
Owner

halfgaar commented Jan 8, 2025

I rebased the branch on master, and included a man page.

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.

2 participants