Hi,
I have multiple threads concurrently appending to the same queue. Every thread appends according to the following code snippet:
ExcerptAppender appender = queue.createAppender();
appender.writeMap(msg.toMap());
appender.close();
As you can see, every time a thread needs to write a message, it creates an appender (which is stored in thread local), writes the message an closes the appender (I'm not sure if it's needed to close the appender after each write?)
Also, I have one tailer created by a separate application as follows:
ExcerptTailer reader = queue.createTailer();
Map<String, Object> msg;
while(running) {
while((msg = reader.readMap()) != null) {
//Add the message to some list for later processing
}
//Process the bulk of messages that have just been read
}
reader.close();
Note that the tailer is kept open until the application is stopped.
Using the following code, I see that my tailer doesn't always synchronize with the cycles. I got multiple times in the situation where the tailer stays on the same cycle while the appenders continuously appends to new files (new cycles).
Any idea?
Thanks,
Mickael