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

Rewrite rules #126

Closed
Hades32 opened this issue May 7, 2015 · 6 comments
Closed

Rewrite rules #126

Hades32 opened this issue May 7, 2015 · 6 comments
Labels
Milestone

Comments

@Hades32
Copy link
Contributor

Hades32 commented May 7, 2015

feature request

Motivation

When operating a system for a longer time you will want to "refactor" your topic structure, just like any other part of your system. But when the clients cannot be update instantly (like IoT and mobile devices) this is a problem. Either you make double subscriptions and double your publications for the old and the new topic structure or you keep everything as it is and only add new stuff.

Solution Proposal

In the world of HTTP the solution to above's problem has long been established: rewrite rules. E.g. an Apache has some regex that makes http://host.com/old/customers and changes it to http://host.com/new/sub/customers .

I'm proposing a similar feature for mqtt. The most straight forward approach I could think of would be to allow regex search and replace on a per Publish/Subscribe message base. So that the replacement could happen when a sub or pub arrives and the rest of the system always only sees the new topics.

@emqplus emqplus added this to the 0.8.0 milestone May 25, 2015
@emqplus
Copy link
Contributor

emqplus commented May 25, 2015

An experimental design in 0.8.0 release: https://github.com/emqtt/emqttd/wiki/Rewrite

@emqplus
Copy link
Contributor

emqplus commented May 25, 2015

@Hades32, released 0.8.0-alpha with this feature. please try it.

@emqplus emqplus closed this as completed May 25, 2015
@Hades32
Copy link
Contributor Author

Hades32 commented May 29, 2015

It's working very well! Great!

What I haven't tried yet: I assume ACLs are applied after the rewrite. Correct?

@emqplus
Copy link
Contributor

emqplus commented May 30, 2015

No, ACL are applied before rewrite.

@emqplus emqplus reopened this May 30, 2015
@emqplus emqplus closed this as completed Jun 2, 2015
@Hades32
Copy link
Contributor Author

Hades32 commented Jun 2, 2015

so, have you come to the conclusion, that it is better to have them applied BEFORE rewrite?

@emqplus
Copy link
Contributor

emqplus commented Jun 3, 2015

@Hades32, no finally conclusion. We could improve the design when more users use the Rewrite feature. For this feature is planned in 0.8.0 release, I close it first and we could submit new issue to enhance this feature in the late release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants