-
Notifications
You must be signed in to change notification settings - Fork 387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to shut down a stream cleanly #20
Comments
I'm working on this now as a part of #21. |
@xelax Error handling can be realized using the API like in following example: |
@xelax you can also use more idiomatic way to handle errors. I'm hoping to add some documentation soon. Here's a quick example: val decider: Supervision.Decider = {
case _ => Supervision.Resume
}
Source(kafkaPublisher)
.withAttributes(ActorAttributes.supervisionStrategy(decider))
.runWith(someSink) |
@xelax looks like I gave a wrong example. A source will not restart on errors, it will just propagate the error further by calling onError() on its subscribers. Here's a better example of custom error, handling, which is meaningful for a Sink: val decider: Supervision.Decider = {
case _ => Supervision.Resume // Your custom handling
}
Source(publisher)
.map(_.message().toUpperCase)
.to(Sink(kafkaSubscribe).withAttributes(ActorAttributes.supervisionStrategy(decider)))
.run() |
I would like to see an example of how to shut down kafka source cleanly and how to detect errors (for example if the kafka server goes down or if the connection fails)
The text was updated successfully, but these errors were encountered: