emqx-exproto icon indicating copy to clipboard operation
emqx-exproto copied to clipboard

Need to clarify the differences between emqx-exproto and emqx-extension-hook

Open daadu opened this issue 4 years ago • 3 comments

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.

daadu avatar Sep 04 '20 18:09 daadu

@tigercl or @HJianBo Can you clarify this?

daadu avatar Feb 12 '21 14:02 daadu

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.

daadu avatar Feb 12 '21 14:02 daadu

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.

HJianBo avatar Feb 13 '21 10:02 HJianBo