MessageBus - How to setup Messagebus using Dart-Flutter

Hey Everyone,

I am making a mobile application that uses the Discourse to GET and POST data. At the moment, I am making a request every 30 seconds to see if there are new posts on a topic. This seems like it could potentially harm our forum by accidentally d-dosing ourselfs.

I have been looking for a good solution using WebSockets in Flutter, but no luck yet. For Discourse, I came across MessageBus, which has confounding documentation.

Yet we do have MessageBus setup on our forum as seen in this polling request:
image

So my question is if anyone has any idea how to solve this problem and has any experience using Message bus or Flutter Websockets.

MessageBus is an option - you can find client libraries for Ruby and JS here: GitHub - discourse/message_bus: A reliable and robust messaging bus for Ruby and Rack

But a simpler solution is probably to use Discourse’s WebHooks feature. That way, Discourse can make a web request to your endpoint whenever there is a new topic/post. You can find more information here:

3 Likes