diff --git a/cluster-api/src/main/java/io/aiven/klaw/clusterapi/services/TopicContentsService.java b/cluster-api/src/main/java/io/aiven/klaw/clusterapi/services/TopicContentsService.java index b913a90fd5..8c4ec20530 100644 --- a/cluster-api/src/main/java/io/aiven/klaw/clusterapi/services/TopicContentsService.java +++ b/cluster-api/src/main/java/io/aiven/klaw/clusterapi/services/TopicContentsService.java @@ -18,6 +18,7 @@ public class TopicContentsService { public static final String CUSTOM_OFFSET_SELECTION = "custom"; + public static final int NUMBER_OF_POLLS = 3; final ClusterApiUtils clusterApiUtils; @Value("${klaw.topiccontents.consumergroup.id:notdefined}") @@ -106,12 +107,11 @@ public Map readEvents( } int i = 0; - int numberOfPolls = 3; do { ConsumerRecords consumerRecords = consumer.poll(Duration.ofMillis(500)); consumerRecords.forEach(record -> eventMap.put(record.offset(), record.value())); i++; - } while (i != numberOfPolls); + } while (i != NUMBER_OF_POLLS); consumer.commitAsync(); consumer.close(); diff --git a/core/src/main/java/io/aiven/klaw/service/ClusterApiService.java b/core/src/main/java/io/aiven/klaw/service/ClusterApiService.java index 3e492da13d..d256db4d81 100644 --- a/core/src/main/java/io/aiven/klaw/service/ClusterApiService.java +++ b/core/src/main/java/io/aiven/klaw/service/ClusterApiService.java @@ -259,15 +259,6 @@ public Map getTopicEvents( String consumerGroupId, int tenantId) throws KlawException { - log.debug( - "getTopicEvents {} {} {} {} {} {} {}", - bootstrapHost, - protocol, - topic, - offsetId, - selectedPartitionId, - selectedNumberOfOffsets, - consumerGroupId); getClusterApiProperties(tenantId); Map eventsMap; try {