How TCP connections are managed in case of akka remote communication

I was going through the documentation but could not find details around how TCP connections are managed when akka remoting/cluster is enabled with the following setting

 akka.remote.artery.transport = tcp

When a message is sent to a remote actor, these go over TCP. Creating a new TCP connection on every remote message would be very expensive and I am sure Akka remoting must be using shared connection pool somewhere in case of artery TCP. I would like to know, who and how these connections are managed. Is there any documentation around this that I can read?

1 Like

The connections are opened on demand when a message is sent. It stays open but is closed automatically if no messages are sent to that node within the configured akka.remote.artery.advanced.stop-idle-outbound-after.

1 Like