I am a new Chronicle user, I have two JAVA main classes, one is chronicle source, and other is remote appender.
Source:
public class MQServer {
public static void main(String[] args) throws IOException, InterruptedException {
String basePath = System.getProperty("java.io.tmpdir") + "/getting-started";
Chronicle source = ChronicleQueueBuilder.indexed(basePath).source().bindAddress("localhost", 1234).build();
source.clear();
Thread.currentThread().sleep(1000 * 60 * 60);
}
}
Remote Appender:
public class RemoteAppender {
public static void main(String[] args) throws IOException {
Chronicle chronicle = ChronicleQueueBuilder
.remoteAppender()
.connectAddress("localhost", 1234)
.build();
ExcerptAppender appender = chronicle.createAppender();
appender.startExcerpt(100);
appender.writeObject("Message");
appender.finish();
}
}
I run MQServer there is no error, and when RemoteAppender starts, I get error:
Exception in thread "main" java.lang.IllegalStateException: java.io.IOException: Connection reset by peer
Is there something wrong with my code, or the way i use Chronicle is wrong.