Skip to content

Commit

Permalink
Increasing poll timeout
Browse files Browse the repository at this point in the history
Increasing poll timeout to 10 secs
  • Loading branch information
ruchirvaninasdaq authored Oct 26, 2020
1 parent 46e33d3 commit 6c3042d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public ReadSchemaTopic(){
public Schema readSchema(String topic) throws Exception {
KafkaConsumer schemaConsumer= getConsumer("Control-"+getClientID(securityProps));
schemaConsumer.subscribe(Collections.singletonList(controlSchemaName));
Duration sec = Duration.ofSeconds(5);
Duration sec = Duration.ofSeconds(10);
Schema messageSchema = null;
ConsumerRecord<String,GenericRecord> lastRecord=null;

Expand Down Expand Up @@ -93,7 +93,7 @@ public Set<String> getTopics() throws Exception{

KafkaConsumer schemaConsumer= getConsumer("Control-"+getClientID(securityProps));
schemaConsumer.subscribe(Collections.singletonList(controlSchemaName));
Duration sec = Duration.ofSeconds(5);
Duration sec = Duration.ofSeconds(10);
while (true) {
ConsumerRecords<String, GenericRecord> schemaRecords = schemaConsumer.poll(sec);
if(schemaRecords.isEmpty()){
Expand Down Expand Up @@ -160,4 +160,4 @@ private Schema internalSchema (String topic) throws Exception {
}
}

}
}

0 comments on commit 6c3042d

Please sign in to comment.