I´m using Event Store 2.0.1 and I´m using all the JAR-files for akka 2.2.4.
I also use the eventstore-client_2.10-0.3.0.jar file. Is this the wrong JAR-file?
Yes I have never got it working:
Here´s the code for the reading function:
package eventstore.j.examples;
import akka.actor.;
import akka.actor.Status.Failure;
import akka.event.;
import eventstore.;
import eventstore.j.;
import eventstore.tcp.ConnectionActor;
import java.net.InetSocketAddress;
public class ReadEventExample {
public static void main(String[] args) {
final ActorSystem system = ActorSystem.create();
final Settings settings = new SettingsBuilder()
.address(new InetSocketAddress("127.0.0.1", 1113))
.defaultCredentials("admin", "changeit")
.build();
final ActorRef connection = system.actorOf(ConnectionActor.getProps(settings));
final ActorRef readResult = system.actorOf(Props.create(ReadResult.class));
final ReadEvent readEvent = new ReadEventBuilder("my-stream")
.first()
.resolveLinkTos(false)
.requireMaster(true)
.build();
connection.tell(readEvent, readResult);
}
public static class ReadResult extends UntypedActor {
final LoggingAdapter log = Logging.getLogger(getContext().system(), this);
public void onReceive(Object message) throws Exception {
if (message instanceof ReadEventCompleted) {
final ReadEventCompleted completed = (ReadEventCompleted) message;
final Event event = completed.event();
log.info("event: {}", event);
} else if (message instanceof Failure) {
final Failure failure = ((Failure) message);
final EsException exception = (EsException) failure.cause();
log.error("reason: {}, message: {}", exception.reason(), exception.message());
} else
unhandled(message);
context().system().shutdown();
}
}
}
Okay where can I use the atom interface?