Created
December 19, 2017 13:12
-
-
Save Jayasagar/e56d6dad2e47f6572b4c8d7ca430f438 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
Graph<ClosedShape, Consumer.Control> completionStageGraph = GraphDSL.create(source, (builder, sourceShape) -> { | |
// Add Broadcast | |
// Add Flows | |
// Add Sinks | |
builder | |
.from(...) | |
.viaFanOut(...) | |
.via(...) | |
.to(...); | |
builder | |
.from(...) | |
.via(...) | |
.to(...); | |
return ClosedShape.getInstance(); | |
}); | |
// Run the stream and supervise | |
RunnableGraph.fromGraph(completionStageGraph) | |
.run(materializer) | |
.isShutdown() | |
.whenComplete((done, throwable) -> { | |
log.info("The underlying `KafkaConsumer` has been closed."); | |
getSelf().tell(PoisonPill.getInstance(), getSelf()); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment