Clustering - WebHooks

21 views
Skip to first unread message

Mark Burridge

unread,
May 25, 2021, 6:21:33 PM5/25/21
to vernemq-users
Hi,

I'm evaluating VerneMQ  and so far, in the single node test environment it seems to provide everything I need for my implementation. Essentially, i need to capture/persist to the database based on message content.

In Production i will be clustering the Nodes on individual servers, behind a network load balancer. What I'm unable to determine from the documentation is if the webhooks are localized.

E.G:
Node A and Node B have Client A and Client B respectively subscribed to the same topic.

If client A publishes to the topic, will the "on_publish" web hook be called from Node A or both Node A and B.  

It would seem logical to call the hook only from Node A, but without setting up multiple nodes I'm unable to verify.

I'd greatly appreciate any insight.

Thanks

André Fatton

unread,
May 25, 2021, 6:32:17 PM5/25/21
to vernemq-users
Hi Mark,

all plugin hooks are localized, yes.
So, on_publish will be called on Node A in your scenario. Note that this is unrelated to the fact that the publisher is also a subscriber here.
Note that on_deliver will be called twice. You could consider on_publish relating to incoming messages, and on_deliver relating to outgoing messages.

Hope this helps. A 2-node cluster is quick to setup, so you should be able to easily test all this.
Cheers,
André

Mark Burridge

unread,
May 25, 2021, 6:42:52 PM5/25/21
to vernemq-users
Hi André

Thanks for the prompt reply. The on_publish was the only real concern as I'll need to update a centralized store. The on_delivered is less important as I'll have other ways of verifying delivery. I'm testing on a single node whilst I formulate proof of concept. I will certainly setup a test environment with multiple nodes behind a load balancer before moving to the development phase.

Thanks for the added insight.
Reply all
Reply to author
Forward
0 new messages