In this section, we're going to take a look at creating SSE broadcaster instances. We're going to register SSE event sinks with this SSE broadcaster, and then we're going broadcast events to all registered sinks. Finally, we'll implement a simple HTML chat leveraging SSE.
There's a lot of ground to cover in this section. Let's get started and open our IDE. As usual, to get started, we will prepare a small skeleton project. First up, we will implement the BroadcastResource class, which is the server side for sending SSE broadcasts. We have a few things to do. We will inject the SSE @Context which we need to construct new events. The next thing we need to do is initialize an SSE broadcaster. For this, we will use the @Context we just injected and we'll define an SseBroadcaster so that this is the main instance...