Class MessageStreamResourceJersey


  • @Path("message/stream/jersey")
    public final class MessageStreamResourceJersey
    extends Object
    Resource that aggregates incoming messages and broadcasts them to the registered Server-Sent Even (SSE) client streams.

    Uses the Jersey-specific SSE API.

    Author:
    Marek Potociar
    See Also:
    MessageStreamResourceJaxRs
    • Constructor Detail

      • MessageStreamResourceJersey

        public MessageStreamResourceJersey()
    • Method Detail

      • putMessage

        @PUT
        @Consumes("application/json")
        public void putMessage​(Message message)
        Put a new message to the stream. The message will be broadcast to all registered SSE clients.
        Parameters:
        message - message to be broadcast.
      • getMessageStream

        @GET
        @Produces("text/event-stream")
        public EventOutput getMessageStream()
        Get the new SSE message stream channel.
        Returns:
        new SSE message stream channel.