All pages
Powered by GitBook
1 of 1

Loading...

Subscribe Flow

In this section the subscription flow is described. VerneMQ provides several hooks to intercept the subscription flow. The most important ones are the auth_on_subscribe and auth_on_subscribe_m5 hooks which act as an application level firewall granting or rejecting subscribe requests.

auth_on_subscribe and auth_on_subscribe_m5

The auth_on_subscribe and auth_on_subscribe_m5 hooks allow your plugin to grant or reject subscribe requests sent by a client. They also makes it possible to rewrite the subscribe topic and qos. The auth_on_subscribe hook is specified in the Erlang behaviour and the auth_on_subscribe hook in the behaviour available in the repo.

on_subscribe and on_subscribe_m5

The on_subscribe and on_subscribe_m5 hooks allow your plugin to get informed about an authorized subscribe request. The on_subscribe hook is specified in the Erlang behaviour and the on_subscribe_m5 hook in the behaviour available in the repo.

on_unsubscribe and on_unsubscribe_m5

The on_unsubscribe and on_unsubscribe_m5 hooks allow your plugin to get informed about an unsubscribe request. They also allow you to rewrite the unsubscribe topic if required. The on_subscribe hook is specified in the Erlang behaviour and the on_unsubscribe_m5 hook in the behaviour available in the repo.

auth_on_subscribe_hook
auth_on_subscribe_m5_hook
vernemq_dev
on_subscribe_hook
on_subscribe_m5_hook
vernemq_dev
on_unsubscribe_hook
on_unsubscribe_m5_hook
vernemq_dev