Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 1. works fine
- String topic = "test-topic";
- for (int i = 0; i <= 50; i++) {
- String t = topic + "-" + i;
- AdminUtils.createTopic(zkUtils, t, partitions, replication, defaultProperties, defaultRackAwareMode);
- }
- for (int i = 0; i <= 50; i++) {
- String t = topic + "-" + i;
- Run run = new Run(t, consumerProps); // starts a KafkaConsumer
- dispatcher.submit(run);
- }
- // vs
- // 2. fails sometimes
- for (int i = 50; i <= 100; i++) {
- String t = topic + "-" + i;
- AdminUtils.createTopic(zkUtils, t, partitions, replication, defaultProperties, defaultRackAwareMode);
- Run run = new Run(t, consumerProps); // starts a KafkaConsumer
- dispatcher.submit(run);
- }
Advertisement
Add Comment
Please, Sign In to add comment