Extend this trait to get an easy to use interface for your EventBus module.
Extend this trait to get an easy to use interface for your EventBus module. It relies on the
sender sending JSON requests with an {"action":"<something>"}. It will reply with either a
{"status":"ok"} JSON object or an {"status":"error", "error":"<ERROR_CODE>",
"message":"<detailed message of error>"}. You can provide extra fields in your reply, by adding
a JsonObject to your reply (Ok or Error). If you need to do something asynchronously while
processing the message, use AsyncReply. You just need to map the Future to one of the Ok or
Error replies. Exceptions that you forget to catch will always yield a "MODULE_EXCEPTION" error
code.
Extend this trait to get an easy to use interface for your EventBus module. It relies on the sender sending JSON requests with an
{"action":"<something>"}
. It will reply with either a{"status":"ok"}
JSON object or an{"status":"error", "error":"<ERROR_CODE>", "message":"<detailed message of error>"}
. You can provide extra fields in your reply, by adding a JsonObject to your reply (Ok
orError
). If you need to do something asynchronously while processing the message, useAsyncReply
. You just need to map theFuture
to one of theOk
orError
replies. Exceptions that you forget to catch will always yield a "MODULE_EXCEPTION" error code.