Created
July 5, 2021 17:07
-
-
Save nrchandan/53622258a6634a1cabaafc692ea554e0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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