Skip to content

Instantly share code, notes, and snippets.

@nrchandan
Created July 5, 2021 17:07
Show Gist options
  • Save nrchandan/53622258a6634a1cabaafc692ea554e0 to your computer and use it in GitHub Desktop.
Save nrchandan/53622258a6634a1cabaafc692ea554e0 to your computer and use it in GitHub Desktop.
public class Orchestrator {
public Orchestrator(ProductClient productClient) {
...
}
public static void main(String[] args) {
Iterator<List<Product>> productsIterator = productClient.fetchAllProducts();
while (productsIterator.hasNext()) {
List<Product> products = iterator.next();
products.stream()
.map(Product::transform)
.forEach(Product::publishToKafka)
.forEach(Product::writeToSQL);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment