while (messages.hasNext()) {
FetchedMessage message = messages.next();
try {
GenericRecord genericRecord = serializer.toGenericRecord(message.getPayload());
ILoggingEvent event = serializer.fromGenericRecord(genericRecord);
LoggingContext loggingContext = LoggingContextHelper.getLoggingContext(event.getMDCPropertyMap());
synchronized (messageTable) {
long key = event.getTimeStamp() / eventBucketIntervalMs;
List<KafkaLogEvent> msgList = messageTable.get(key, loggingContext.getLogPathFragment());
if (msgList == null) {
msgList = Lists.newArrayList();
messageTable.put(key, loggingContext.getLogPathFragment(), msgList);
}
msgList.add(new KafkaLogEvent(genericRecord, event, loggingContext,
message.getTopicPartition().getPartition(), message.getNextOffset()));
}
} catch (Throwable e) {