Open marceloverdijk opened 7 years ago
One drawback of using the appcontext events is that is probably more complicated to differentiate evens from multiple chatbots.
E.g. in a single webapp I could add multiple webhook endpoints for various chatbots.
In the current design each webhook endpoint (multiple WebhookServlet
s with their own mapping) has its own CallbackHandler
, so the CallbackHandler
is implemented specifically for a chatbot. When using the appcontext events will not be able the origin chatbot.
@joshlong do you maybe have an idea?
As discussed with @joshlong on Twitter it might interesting to publishing appcontext events instead of making people implement an interface for callbacks.
(FacebookMessageEvent.class) void onMessage (FacebookMessageEvent evt) {..}
Maybe a restfbmessenger-spring module can be introduced with a
CallbackHandler
adapter that publishes the appcontext events. Users can then choose to implement their ownCallbackHandler
or use the adapter and use the Spring events.