akka-projection
akka-projection copied to clipboard
Graceful shutdown of source providers
When a RunningProjection
is stopped, call an (internal only?) async shutdown method in the source provider.
There are multiple reasons for a projection to stop:
- the application is gracefully terminating
- the projection is programmatically stopped (sharded projection moved to another
ShardRegion
) and may be restarted - the envelope handler errored (or there's a projection failure) and the projection will be (or should be) restarted
@seglo , did you have any of these reasons in mind?
@ignasi35 I didn't have any specific cause in mind. I only noticed that the projection has no way of signalling the source provider to shutdown except by way of the SharedKillSwitch
. I was wondering if there was a way to use Alpakka Kafka's DrainingControl
in non-exceptional shutdown circumstances.
I think this is a good idea. That would make it independent of the kind of kill switch is in use.