Skip to content

Commit

Permalink
MODINV-658 - Added a field to initialize kafka consumer from environm…
Browse files Browse the repository at this point in the history
…ent variable. (#493)

(cherry picked from commit 703fc53)
  • Loading branch information
SatishkumarPurswani authored and KaterynaSenchenko committed Mar 25, 2022
1 parent 5dc3490 commit 090ec72
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main/java/org/folio/inventory/Launcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,22 @@ public static void main(String[] args)
String storageType = System.getProperty(
"org.folio.metadata.inventory.storage.type", null);

String kafkaConsumersToBeInitialized = System.getProperty(
"org.folio.metadata.inventory.kafka.consumers.initialized", "true");

String storageLocation = System.getProperty(
"org.folio.metadata.inventory.storage.location", null);

putNonNullConfig("storage.type", storageType, config);
putNonNullConfig("storage.location", storageLocation, config);
putNonNullConfig("port", port, config);

Map<String, Object> consumerVerticlesConfig = getConsumerVerticleConfig();
start(config);
startConsumerVerticles(consumerVerticlesConfig);

if(Boolean.parseBoolean(kafkaConsumersToBeInitialized)){
Map<String, Object> consumerVerticlesConfig = getConsumerVerticleConfig();
startConsumerVerticles(consumerVerticlesConfig);
}
}

private static void start(Map<String, Object> config)
Expand Down

0 comments on commit 090ec72

Please sign in to comment.