Webhook: Call http endpoint for auth and on message publish
delfme opened this issue · 1 comments
Is your feature request related to a problem? Please describe.
Hello, is there a way to configure the broker to forward the user credentials and the mqtt messages to an http endpoint via webhook?
Describe the solution you'd like
We basically uses a Nodejs endpoint that authenticates user over JWT (broker sends to endpoint the username field onAuth svent) and also receives incoming mqtt messages' payload (onPublish) to take action accordingly.
Describe alternatives you've considered
We currently use Vernemq broker to enjoy above feature, but would like to test bifromq if these features were available.
BifroMQ does not directly support webhooks; however, one can implement them using the plugin mechanism. In your scenario, the 'auth hook' could be achieved by using a customized auth provider plugin, which some of our users have actually done. As for the 'message hook', we recommend using a decoupled data integration approach. You can leverage the companion project 'bifromq-data-integration' as a starting point.