emqx-exproto
emqx-exproto copied to clipboard
Need to clarify the differences between emqx-exproto and emqx-extension-hook
Since, both the plugins can be used for "similar" use-cases. The differences and similarities should be clarified either in README or a blog post on the site, to avoid confusion.
@tigercl or @HJianBo Can you clarify this?
A little bit of reading and this is what I conclude (correct me if I am wrong!)
-
emqx-extension-hook
: is based on "hook" mechanism of emqx , so the extension adds a "hook" to the flow of messages (published_message, auth, contention, session, etc), using this you can not "publish" message lets say. you just get callbacks for various "hooks" (some expecting a return value while other do not). "hooks" are blocking, that is if your implementation hangs then the message is not processed. -
emqx-exproto
: is based on "protocol access", this gives access to various APIs of emqx (connection, pub/sub, etc). apart from callbacks it also gives access to APIs that can perform - publish_message, disconnect a client, etc. the callbacks here are non-blocking (I am assuming), as all interactions are API base.
This is the major difference I found. @tigercl @HJianBo please throw some light on it.
emqx-extension-hook: is based...
Right.
emqx-exproto: is based ...
No. The emqx-exproto
allows users to implement their own private application protocols (e.g: A simple TCP-based protocol) using Java/Python etc. All of the APIs provided are based on this goal.