Book Image

RabbitMQ Essentials

By : David Dossot
Book Image

RabbitMQ Essentials

By: David Dossot

Overview of this book

Table of Contents (17 chapters)

Moving beyond polling


Clever Coney Media is enjoying the application inbox feature that was rolled out in the previous chapter. Users enjoy it very much as well. Everything works fine except for the fact that the frontend regularly polling the backend for messages is starting to take its toll in terms of load, meaning it has begun to suffer performance degradation. Granted, the slow polling mechanism that was initially in place between the frontend and the backend was not designed to perform more than a basic ping. A better approach is needed.

CCM decides to re-architect the solution in favor of a server-push approach. The idea is to server-push messages to the users' browsers whenever a message is available, instead of regularly polling to fetch a message or, more often than not, nothing. The good news is that there is a technology perfect for this use case: WebSocket. Well supported by modern browsers, this protocol has the advantage of being full-duplex, which means that messages will...