@Test public void testConfigValidations() { final KafkaSystemConsumer consumer = createConsumer(FETCH_THRESHOLD_MSGS, FETCH_THRESHOLD_BYTES); consumer.start(); // should be no failures }
@Test public void testFetchThresholdShouldDivideEvenlyAmongPartitions() { final KafkaSystemConsumer consumer = createConsumer(FETCH_THRESHOLD_MSGS, FETCH_THRESHOLD_BYTES); final int partitionsNum = 50; for (int i = 0; i < partitionsNum; i++) { consumer.register(new SystemStreamPartition(TEST_SYSTEM, TEST_STREAM, new Partition(i)), "0"); } consumer.start(); Assert.assertEquals(Long.valueOf(FETCH_THRESHOLD_MSGS) / partitionsNum, consumer.perPartitionFetchThreshold); Assert.assertEquals(Long.valueOf(FETCH_THRESHOLD_BYTES) / 2 / partitionsNum, consumer.perPartitionFetchThresholdBytes); consumer.stop(); }
consumer.start(); consumer.messageSink.addMessage(ssp0, ime0);
consumer.start(); consumer.messageSink.addMessage(ssp0, ime0);