Skip to content
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

Document controlled shutdown when using RestartSource #1291

Open
ennru opened this issue Dec 18, 2020 · 2 comments
Open

Document controlled shutdown when using RestartSource #1291

ennru opened this issue Dec 18, 2020 · 2 comments

Comments

@ennru
Copy link
Member

ennru commented Dec 18, 2020

Short description

Combining RestartSource with controlled shutdown a la DrainingControl should be illustrated with an example.

Details

The example in https://doc.akka.io/docs/alpakka-kafka/current/errorhandling.html#restarting-the-stream-with-a-backoff-stage should show controlled shutdown:

control.get().drainAndShutdown(result)

@patriknw
Copy link
Member

patriknw commented Feb 12, 2021

Using such AtomicReference and mapMaterializedValue is rather painful. I think it's very common to use a RestartSource with the Alpakka Kafka consumers. Could we come up with something that's more convenient? Could we include it automatically if enabled in ConsumerSettings?

@seglo
Copy link
Member

seglo commented Feb 12, 2021

We discussed making a new experimental API for RestartSource to propagate materialized values better. I think that's worth experimenting within Alpakka Kafka.

I don't think just wrapping the consumer sources in RestartSource (when a feature flag is enabled) will work because part of the controlled shutdown process is to wait for any outstanding commits to complete, which is returned as a materialized value by a committer stage, or the combined producer committer sink (I think) later in the stream. The draining control makes use of the future emitted by the sink to determine that draining is complete.

https://doc.akka.io/docs/alpakka-kafka/current/consumer.html#draining-control

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants