Chapter 17. WebSockets with Spring Boot
Hell yeah @springboot rocks! (after winning JAX Innovation Award 2016)
– Andrew Rubalcaba @Han_Cholo
In the previous chapter, we learned how to split our application into microservices driven by bounded contexts. Yet, we still linked things together in an efficient manner using Spring Cloud.
When it comes to building a social media platform, the standard has been set very high. We all expect dynamic updates to whatever content we view. If someone comments on a topic that we are also viewing, we expect to be alerted to the update immediately. Such fluid changes are made possible through the power of WebSockets.
In this chapter, we will cover the following topics:
- Publishing saved comments to a chat service
- Broadcasting saved comments to web subscribers
- Configuring a WebSocket broker
- Consuming messages from the web asynchronously
- Introducing user chatting with channel-wide and user-specific messages
We will use Spring's reactive WebSocket API found in WebFlux...