+ " consumer threads");
System.out.println("Rate limit:" + config.getMessagesPerSecond());
LinkedList<Consumer> consumers = new LinkedList<Consumer>();
long startMillis = System.currentTimeMillis();
for (int i = 0; i < config.getConsumerThreads(); ++i) {
Consumer consumer = new Consumer(config);
consumer.setUncaughtExceptionHandler(handler);
consumers.add(consumer);
consumer.start();
}
while (true) {
for (Consumer consumer : consumers) {
for (String topic : topics) {
for (int i = 0; i < num_partitions; i++) {
OffsetTracker offsetTracker = consumer
.getOffsetTracker();
long val = (offsetTracker == null) ? -1
: offsetTracker
.getLastSeenOffset(new TopicPartition(
topic, i)) + 1;