Java client for EventStore (http://geteventstore.com)
Java Protocol Buffer Shell
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
client
doc
.gitignore
LICENSE
README.md

README.md

esj

Java client for EventStore (http://geteventstore.com)

Build Status Maven Central LGPLv3 License Java Development Kit 1.7

Project website

About

Event Store Java client. Designed to help Java programs easily communicate with Event Store database.

Functionality

Java client functionality:

  • Append event to stream
  • Read from stream
  • Subscribe to stream
  • Delete stream
  • Read events from stream

Code example

Append to stream example:


import lt.emasina.esj.EventStore;
import lt.emasina.esj.model.Message;
...
EventStore es = new EventStore(InetAddress.getByName(HOSTNAME), PORTNUMBER);
...
es.appendToStream(STREAM_NAME, new ResponseReceiver() {
	@Override
	public void onResponseReturn(Message msg) {
		// do something
	},
	@Override
	public void onErrorReturn(Exception ex){
		// do something
	}
},EVENT);
...
es.close();

or in Java 7 manner:


import lt.emasina.esj.EventStore;
import lt.emasina.esj.model.Message;
...
try (EventStore es = new EventStore(InetAddress.getByName(HOSTNAME), PORTNUMBER)) {
    ...
    es.appendToStream(STREAM_NAME, new ResponseReceiver() {
	@Override
	public void onResponseReturn(Message msg) {
		// do something
	},
	@Override
	public void onErrorReturn(Exception ex){
		// do something
	}
    },EVENT);
    ...
}