Skip to content
/ java-sse-client Public template

Full implementation of a HTTP event stream client that listen for Server-Sent Events (SSE).

License

Notifications You must be signed in to change notification settings

LupCode/java-sse-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Event Stream Client for Server-Sent Events

Full implementation of a HTTP event stream client that listen for Server-Sent Events (SSE).
Requires Java 11 or higher, no other libraries are needed.

How to use:

HttpEventStreamClient client = new HttpEventStreamClient("https://sse.example.com", new EventStreamAdapter() {
			
	@Override
	public void onEvent(HttpEventStreamClient client, Event event) {
		System.out.println("RECEIVED EVENT: "+event.toString());
	}

	@Override
	public void onClose(HttpEventStreamClient client, HttpResponse<Void> response) {
		System.out.println("SSE Client closed");
	}

});
client.start().join();

References:

Releases

No releases published

Packages

No packages published

Languages