Skip to content

Commit

Permalink
Add constant, from review
Browse files Browse the repository at this point in the history
Signed-off-by: muralibasani <[email protected]>
  • Loading branch information
muralibasani committed Nov 23, 2023
1 parent ad9bd1f commit d8d799b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down Expand Up @@ -106,12 +107,11 @@ public Map<Long, String> readEvents(
}

int i = 0;
int numberOfPolls = 3;
do {
ConsumerRecords<String, String> 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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,15 +259,6 @@ public Map<String, String> getTopicEvents(
String consumerGroupId,
int tenantId)
throws KlawException {
log.debug(
"getTopicEvents {} {} {} {} {} {} {}",
bootstrapHost,
protocol,
topic,
offsetId,
selectedPartitionId,
selectedNumberOfOffsets,
consumerGroupId);
getClusterApiProperties(tenantId);
Map<String, String> eventsMap;
try {
Expand Down

0 comments on commit d8d799b

Please sign in to comment.