Warning: PoisonPill will not be supported in the future

Hi, I’ve recently upgrade Akka version in one of my applications and I’m getting a lot of the following warning logs:

ActorRefSource(akka:// ... ): for backwards compatibility: PoisonPill will not be supported in the future

The log message itself is pretty clear. So I understand that it is desirable to stop using PoisonPill messages but I couldn’t find any relevant documentation on why it was deprecated and the best practice to replace it.

I can create the same behavior with a custom message in my application but since I don’t know why it was deprecated. I want to avoid to accidentally replicate the same thing that caused PoisonPill to be deprecated in the first place.

Does anyone know why it was deprecated and the best way to replace it?

That is for Source.actorRef in Akka Streams, not for actors in general. Instead of using PoisonPill you should define a custom message when you create the Source.actorRef and use that as the completion signal. That is done with the completionMatcher, see API docs.