Understanding Bayeux

As for the comet, I often hear about Bayeux. I know that:

Bayeux is a protocol for transporting asynchronous messages (mostly over HTTP) with low latency between a web server.

But is it important? It's necessary? Are there any alternatives? Is everyone using it? Is Bayeux the only protocol? Are there any sites like Facebook? what doesn't Bayeux use? Is Google Wave Equivalent?

Thank.

+2


source to share


2 answers


It is used primarily for long polling communication.

Most web communications tend to be one way. The client sends a request to the server and the server returns some data. Typically, the server can send data to the client when it responds to a request from the client.

On long polling, the client browser will open a connection to the server. The server may return some data, but does not close the connection. This connection remains open. Then, when the server needs to send some data to the client, it just sends it over that connection.



This is the only way to make the web server send information to the web client instantly. Useful in chats, etc.

This can be done with any (or at least most) web servers; however, keeping the client connection open can be resource intensive. If you have 20,000 clients doing this on a single IIS server, it will result in the loss of the machine. He won't be able to handle it.

Bayeux is a very effective way to achieve this. Using Jetty with the CometD library that implements Bayeux, 20,000 concurrent clients don't sweat!

+2


source


Well, it can also be used for push applications or vice versa ajax or wahtever that you want to call. I just wrote a blog about it and created a sample app: http://geeks.aretotally.in/thinking-in-reverse-not-taking-orders-from-yo http://jaye.felipera.cloudbees.net/



Source code is available, deploy it to Github.

-1


source







All Articles