Class SseEventSource.Builder

java.lang.Object
jakarta.ws.rs.sse.SseEventSource.Builder
Enclosing interface:
SseEventSource

public abstract static class SseEventSource.Builder extends Object
JAX-RS SseEventSource builder class.

Event source builder provides methods that let you conveniently configure and subsequently build a new SseEventSource instance. You can obtain a new event source builder instance using a static SseEventSource.target(endpoint) factory method.

For example:

 SseEventSource es = SseEventSource.target(endpoint)
         .reconnectingEvery(5, SECONDS)
         .build();
 es.register(System.out::println);
 es.open();