private final Consumer<String, MessageTo> consumer;
private final String topic;
private final long[] offsets;
- private final MessageHandler[] handlers;
private final Map<UUID, ChatRoom>[] chatrooms;
this.consumer = consumer;
this.topic = topic;
this.offsets = new long[numShards];
- this.handlers = new MessageHandler[numShards];
+ this.chatrooms = new Map<>[numShards];
for (int i=0; i< numShards; i++)
{
this.offsets[i] = 0l;
- this.handlers[i] = new MessageHandler(consumer, new TopicPartition(topic, i));
+ this.chatrooms[i] = chat
}
this.chatrooms = new Map[numShards];
+ this.chatrooms = new Map[numShards];
}
int partition = tp.partition();
long unseenOffset = offsets[partition];
- log.info("Reading partition {} from {} -> {}", partition, unseenOffset, currentOffset);
+ log.info(
+ "Loading messages from partition {}: start-offset={} -> current-offset={}",
+ partition,
+ unseenOffset,
+ currentOffset);
handlers[partition] = new ChatRoomLoadingMessageHandlingStrategy(tp, currentOffset, unseenOffset);
});
}