O'Reilly logo

RESTful Java Patterns and Best Practices by Bhakti Mehta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Comparisons between WebHooks, WebSockets, and server-sent events

SSEs are sent over HTTP unlike WebSockets. SSEs offer only one-way communication of events from the server to the client and do not support a full-duplex communication as WebSockets do. SSEs have the ability to automatically retry a connection; they also have event IDs that can be associated with messages to provide Quality of Service (QoS) features. The WebSockets specification does not support these features.

On the other hand, WebSockets support full-duplex communication, and reduce the latency and help improve throughput, as there is an initial handshake over HTTP, but then, the messages are transferred between endpoints over TCP.

In comparison to the two protocols mentioned earlier, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required