Java client for EventStore (http://geteventstore.com)
Event Store Java client. Designed to help Java programs easily communicate with Event Store database.
Java client functionality:
- Append event to stream
- Read from stream
- Subscribe to stream
- Delete stream
- Read events from stream
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);
...
}