diff --git a/akka-multi-node-testkit/src/main/scala/akka/remote/testkit/MultiNodeSpec.scala b/akka-multi-node-testkit/src/main/scala/akka/remote/testkit/MultiNodeSpec.scala index dabd86f341..2ba21c2207 100644 --- a/akka-multi-node-testkit/src/main/scala/akka/remote/testkit/MultiNodeSpec.scala +++ b/akka-multi-node-testkit/src/main/scala/akka/remote/testkit/MultiNodeSpec.scala @@ -200,10 +200,10 @@ object MultiNodeSpec { private[testkit] val nodeConfig = mapToConfig(Map( "akka.actor.provider" → "remote", - "akka.remote.artery.hostname" → selfName, + "akka.remote.artery.canonical.hostname" → selfName, "akka.remote.netty.tcp.hostname" → selfName, "akka.remote.netty.tcp.port" → selfPort, - "akka.remote.artery.port" → selfPort)) + "akka.remote.artery.canonical.port" → selfPort)) private[testkit] val baseConfig: Config = ConfigFactory.parseString(""" akka { diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteNodeRestartDeathWatchSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteNodeRestartDeathWatchSpec.scala index 7ac9d1c531..2a7a838e69 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteNodeRestartDeathWatchSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteNodeRestartDeathWatchSpec.scala @@ -114,7 +114,7 @@ abstract class RemoteNodeRestartDeathWatchSpec(multiNodeConfig: RemoteNodeRestar val freshSystem = ActorSystem(system.name, ConfigFactory.parseString(s""" akka.remote.netty.tcp.port = ${addr.port.get} - akka.remote.artery.port = ${addr.port.get} + akka.remote.artery.canonical.port = ${addr.port.get} """).withFallback(system.settings.config)) freshSystem.actorOf(Props[Subject], "subject") diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteNodeShutdownAndComesBackSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteNodeShutdownAndComesBackSpec.scala index 9102832593..dc72e998a0 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteNodeShutdownAndComesBackSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteNodeShutdownAndComesBackSpec.scala @@ -136,7 +136,7 @@ abstract class RemoteNodeShutdownAndComesBackSpec val freshSystem = ActorSystem(system.name, ConfigFactory.parseString(s""" akka.remote.netty.tcp.port = ${addr.port.get} - akka.remote.artery.port = ${addr.port.get} + akka.remote.artery.canonical.port = ${addr.port.get} """).withFallback(system.settings.config)) freshSystem.actorOf(Props[Subject], "subject") diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteQuarantinePiercingSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteQuarantinePiercingSpec.scala index ce0a22005b..170fdfa4f6 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteQuarantinePiercingSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteQuarantinePiercingSpec.scala @@ -115,7 +115,7 @@ abstract class RemoteQuarantinePiercingSpec(multiNodeConfig: RemoteQuarantinePie val freshSystem = ActorSystem(system.name, ConfigFactory.parseString(s""" akka.remote.netty.tcp.port = ${addr.port.get} - akka.remote.artery.port = ${addr.port.get} + akka.remote.artery.canonical.port = ${addr.port.get} """).withFallback(system.settings.config)) freshSystem.actorOf(Props[Subject], "subject") diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/HandshakeRestartReceiverSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/HandshakeRestartReceiverSpec.scala index 648c4e41ff..6e5ec4d812 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/HandshakeRestartReceiverSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/HandshakeRestartReceiverSpec.scala @@ -105,7 +105,7 @@ abstract class HandshakeRestartReceiverSpec Await.result(system.whenTerminated, 10.seconds) val freshSystem = ActorSystem(system.name, ConfigFactory.parseString(s""" - akka.remote.artery.port = ${addr.port.get} + akka.remote.artery.canonical.port = ${addr.port.get} """).withFallback(system.settings.config)) freshSystem.actorOf(Props[Subject], "subject2") diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/RemoteRestartedQuarantinedSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/RemoteRestartedQuarantinedSpec.scala index 1cdcc74fc1..b7bc87155a 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/RemoteRestartedQuarantinedSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/RemoteRestartedQuarantinedSpec.scala @@ -116,7 +116,7 @@ abstract class RemoteRestartedQuarantinedSpec Await.result(system.whenTerminated, 10.seconds) val freshSystem = ActorSystem(system.name, ConfigFactory.parseString(s""" - akka.remote.artery.port = ${addr.port.get} + akka.remote.artery.canonical.port = ${addr.port.get} """).withFallback(system.settings.config)) val probe = TestProbe()(freshSystem) diff --git a/akka-remote/src/main/resources/reference.conf b/akka-remote/src/main/resources/reference.conf index bd266bc3f8..eed3fe538c 100644 --- a/akka-remote/src/main/resources/reference.conf +++ b/akka-remote/src/main/resources/reference.conf @@ -86,15 +86,50 @@ akka { remote { artery { - enabled = off - port = 20200 - # The hostname or ip clients should connect to. - # InetAddress.getLocalHost.getHostAddress is used if empty or - # "" is specified. - # InetAddress.getLocalHost.getHostName is used if - # "" is specified. - hostname = "" + ### FIXME: Temporary switch for the PoC + enabled = off + + # Canonical address is the address other clients should connect to. + # Artery transport will expect messages to this address. + canonical { + + # The default remote server port clients should connect to. + # Default is 25520, use 0 if you want a random available port + # This port needs to be unique for each actor system on the same machine. + port = 25520 + + # Hostname clients should connect to. Can be set to an ip, hostname + # or one of the following special values: + # "" InetAddress.getLocalHost.getHostAddress + # "" InetAddress.getLocalHost.getHostName + # + hostname = "" + } + + # Use these settings to bind a network interface to a different address + # than artery expects messages at. This may be used when running Akka + # nodes in a separated networks (under NATs or in containers). If canonical + # and bind addresses are different, then network configuration that relays + # communications from canonical to bind addresses is expected. + bind { + + # Port to bind a network interface to. Can be set to a port number + # of one of the following special values: + # 0 random available port + # "" akka.remote.artery.canonical.port + # + port = "" + + # Hostname to bind a network interface to. Can be set to an ip, hostname + # or one of the following special values: + # "0.0.0.0" all interfaces + # "" akka.remote.artery.canonical.hostname + # "" InetAddress.getLocalHost.getHostAddress + # "" InetAddress.getLocalHost.getHostName + # + hostname = "" + } # Actor paths to use the large message stream for when a message # is sent to them over remoting. The large message stream dedicated @@ -153,16 +188,16 @@ akka { # Level 1 strongly prefer low CPU consumption over low latency. # Level 10 strongly prefer low latency over low CPU consumption. idle-cpu-level = 5 - + # Number of outbound lanes for each outbound association. A value greater than 1 # means that serialization can be performed in parallel for different destination # actors. The selection of lane is based on consistent hashing of the recipient # ActorRef to preserve message ordering per receiver. outbound-lanes = 1 - - # Total number of inbound lanes, shared among all inbound associations. A value - # greater than 1 means that deserialization can be performed in parallel for - # different destination actors. The selection of lane is based on consistent + + # Total number of inbound lanes, shared among all inbound associations. A value + # greater than 1 means that deserialization can be performed in parallel for + # different destination actors. The selection of lane is based on consistent # hashing of the recipient ActorRef to preserve message ordering per receiver. inbound-lanes = 1 diff --git a/akka-remote/src/main/scala/akka/remote/BoundAddressesExtension.scala b/akka-remote/src/main/scala/akka/remote/BoundAddressesExtension.scala index 07d1df14b8..9e931fde62 100644 --- a/akka-remote/src/main/scala/akka/remote/BoundAddressesExtension.scala +++ b/akka-remote/src/main/scala/akka/remote/BoundAddressesExtension.scala @@ -9,6 +9,7 @@ import akka.actor.ExtendedActorSystem import akka.actor.Extension import akka.actor.ExtensionId import akka.actor.ExtensionIdProvider +import akka.remote.artery.ArteryTransport /** * Extension provides access to bound addresses. @@ -27,6 +28,8 @@ class BoundAddressesExtension(val system: ExtendedActorSystem) extends Extension * Returns a mapping from a protocol to a set of bound addresses. */ def boundAddresses: Map[String, Set[Address]] = system.provider - .asInstanceOf[RemoteActorRefProvider].transport - .asInstanceOf[Remoting].boundAddresses + .asInstanceOf[RemoteActorRefProvider].transport match { + case artery: ArteryTransport ⇒ Map((ArteryTransport.ProtocolName → Set(artery.bindAddress.address))) + case remoting: Remoting ⇒ remoting.boundAddresses + } } diff --git a/akka-remote/src/main/scala/akka/remote/artery/ArterySettings.scala b/akka-remote/src/main/scala/akka/remote/artery/ArterySettings.scala index fa68f8c5e5..6f008d4235 100644 --- a/akka-remote/src/main/scala/akka/remote/artery/ArterySettings.scala +++ b/akka-remote/src/main/scala/akka/remote/artery/ArterySettings.scala @@ -22,12 +22,30 @@ private[akka] final class ArterySettings private (config: Config) { import ArterySettings._ val Enabled: Boolean = getBoolean("enabled") - val Port: Int = getInt("port") - val Hostname: String = getString("hostname") match { - case "" | "" ⇒ InetAddress.getLocalHost.getHostAddress - case "" ⇒ InetAddress.getLocalHost.getHostName - case other ⇒ other + + object Canonical { + val config = getConfig("canonical") + import config._ + + val Port: Int = getInt("port").requiring(port ⇒ + 0 to 65535 contains port, "canonical.port must be 0 through 65535") + val Hostname: String = getHostname("hostname", config) } + + object Bind { + val config = getConfig("bind") + import config._ + + val Port: Int = getString("port") match { + case "" ⇒ Canonical.Port + case other ⇒ getInt("port").requiring(port ⇒ 0 to 65535 contains port, "bind.port must be 0 through 65535") + } + val Hostname: String = getHostname("hostname", config) match { + case "" ⇒ Canonical.Hostname + case other ⇒ other + } + } + val LargeMessageDestinations = config.getStringList("large-message-destinations").asScala.foldLeft(WildcardIndex[NotUsed]()) { (tree, entry) ⇒ val segments = entry.split('/').tail @@ -126,4 +144,10 @@ private[akka] object ArterySettings { // Compile time constants final val Debug = false // unlocks additional very verbose debug logging of compression events (on DEBUG log level) } + + def getHostname(key: String, config: Config) = config.getString(key) match { + case "" ⇒ InetAddress.getLocalHost.getHostAddress + case "" ⇒ InetAddress.getLocalHost.getHostName + case other ⇒ other + } } diff --git a/akka-remote/src/main/scala/akka/remote/artery/ArteryTransport.scala b/akka-remote/src/main/scala/akka/remote/artery/ArteryTransport.scala index 8cbbcbba9b..c7f04f6e81 100644 --- a/akka-remote/src/main/scala/akka/remote/artery/ArteryTransport.scala +++ b/akka-remote/src/main/scala/akka/remote/artery/ArteryTransport.scala @@ -287,6 +287,7 @@ private[remote] class ArteryTransport(_system: ExtendedActorSystem, _provider: R // these vars are initialized once in the start method @volatile private[this] var _localAddress: UniqueAddress = _ + @volatile private[this] var _bindAddress: UniqueAddress = _ @volatile private[this] var _addresses: Set[Address] = _ @volatile private[this] var materializer: Materializer = _ @volatile private[this] var controlSubject: ControlMessageSubject = _ @@ -297,6 +298,7 @@ private[remote] class ArteryTransport(_system: ExtendedActorSystem, _provider: R @volatile private[this] var inboundCompressions: Option[InboundCompressions] = None + def bindAddress: UniqueAddress = _bindAddress override def localAddress: UniqueAddress = _localAddress override def defaultAddress: Address = localAddress.address override def addresses: Set[Address] = _addresses @@ -328,7 +330,7 @@ private[remote] class ArteryTransport(_system: ExtendedActorSystem, _provider: R .insert(Array("system", "cluster", "core", "daemon", "heartbeatSender"), NotUsed) .insert(Array("system", "cluster", "heartbeatReceiver"), NotUsed) - private def inboundChannel = s"aeron:udp?endpoint=${localAddress.address.host.get}:${localAddress.address.port.get}" + private def inboundChannel = s"aeron:udp?endpoint=${_bindAddress.address.host.get}:${_bindAddress.address.port.get}" private def outboundChannel(a: Address) = s"aeron:udp?endpoint=${a.host.get}:${a.port.get}" private val controlStreamId = 1 @@ -388,16 +390,27 @@ private[remote] class ArteryTransport(_system: ExtendedActorSystem, _provider: R topLevelFREvents.loFreq(Transport_TaskRunnerStarted, NoMetaData) val port = - if (settings.Port == 0) ArteryTransport.autoSelectPort(settings.Hostname) - else settings.Port + if (settings.Canonical.Port == 0) { + if (settings.Bind.Port != 0) settings.Bind.Port // if bind port is set, use bind port instead of random + else ArteryTransport.autoSelectPort(settings.Canonical.Hostname) + } else settings.Canonical.Port + + val bindPort = if (settings.Bind.Port == 0) { + if (settings.Canonical.Port == 0) port // canonical and bind ports are zero. Use random port for both + else ArteryTransport.autoSelectPort(settings.Bind.Hostname) + } else settings.Bind.Port // TODO: Configure materializer properly // TODO: Have a supervisor actor _localAddress = UniqueAddress( - Address(ArteryTransport.ProtocolName, system.name, settings.Hostname, port), + Address(ArteryTransport.ProtocolName, system.name, settings.Canonical.Hostname, port), AddressUidExtension(system).longAddressUid) _addresses = Set(_localAddress.address) + _bindAddress = UniqueAddress( + Address(ArteryTransport.ProtocolName, system.name, settings.Bind.Hostname, bindPort), + AddressUidExtension(system).longAddressUid) + // TODO: This probably needs to be a global value instead of an event as events might rotate out of the log topLevelFREvents.loFreq(Transport_UniqueAddressSet, _localAddress.toString().getBytes("US-ASCII")) diff --git a/akka-remote/src/test/scala/akka/remote/artery/ArteryMultiNodeSpec.scala b/akka-remote/src/test/scala/akka/remote/artery/ArteryMultiNodeSpec.scala index 4640772ec8..908bf25f3d 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/ArteryMultiNodeSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/ArteryMultiNodeSpec.scala @@ -16,8 +16,10 @@ object ArteryMultiNodeSpec { actor.warn-about-java-serializer-usage = off remote.artery { enabled = on - hostname = localhost - port = 0 + canonical { + hostname = localhost + port = 0 + } } } """) diff --git a/akka-remote/src/test/scala/akka/remote/artery/BindCanonicalAddressSpec.scala b/akka-remote/src/test/scala/akka/remote/artery/BindCanonicalAddressSpec.scala new file mode 100644 index 0000000000..709959d4b3 --- /dev/null +++ b/akka-remote/src/test/scala/akka/remote/artery/BindCanonicalAddressSpec.scala @@ -0,0 +1,83 @@ +package akka.remote.artery + +import akka.testkit.AkkaSpec +import com.typesafe.config.ConfigFactory +import akka.actor.ActorSystem +import akka.remote.transport.netty.NettyTransportSpec._ +import scala.concurrent.Await +import org.scalatest.WordSpec +import org.scalatest.Matchers +import scala.concurrent.duration.Duration +import akka.testkit.SocketUtil +import java.net.InetAddress + +class BindCanonicalAddressSpec extends WordSpec with Matchers { + import BindCanonicalAddressSpec._ + + "artery" should { + + "bind to a random port" in { + val config = ConfigFactory.parseString(s""" + akka.remote.artery.canonical.port = 0 + """) + + implicit val sys = ActorSystem("sys", config.withFallback(commonConfig)) + + getInternal should contain(getExternal) + Await.result(sys.terminate(), Duration.Inf) + } + + "bind to a random port but remoting accepts from a specified port" in { + val address = SocketUtil.temporaryServerAddress(InetAddress.getLocalHost.getHostAddress, udp = true) + + val config = ConfigFactory.parseString(s""" + akka.remote.artery.canonical.port = ${address.getPort} + akka.remote.artery.bind.port = 0 + """) + + implicit val sys = ActorSystem("sys", config.withFallback(commonConfig)) + + getExternal should ===(address.toAkkaAddress("akka")) + getInternal should not contain (address.toAkkaAddress("akka")) + + Await.result(sys.terminate(), Duration.Inf) + } + + "bind to a specified port and remoting accepts from a bound port" in { + val address = SocketUtil.temporaryServerAddress(InetAddress.getLocalHost.getHostAddress, udp = true) + + val config = ConfigFactory.parseString(s""" + akka.remote.artery.canonical.port = 0 + akka.remote.artery.bind.port = ${address.getPort} + """) + + implicit val sys = ActorSystem("sys", config.withFallback(commonConfig)) + + getExternal should ===(address.toAkkaAddress("akka")) + getInternal should contain(address.toAkkaAddress("akka")) + } + + "bind to all interfaces" in { + val config = ConfigFactory.parseString(s""" + akka.remote.artery.bind.hostname = "0.0.0.0" + """) + + implicit val sys = ActorSystem("sys", config.withFallback(commonConfig)) + + getInternal.flatMap(_.port) should contain(getExternal.port.get) + getInternal.map(_.host.get should include regex "0.0.0.0".r) // regexp dot is intentional to match IPv4 and 6 addresses + + Await.result(sys.terminate(), Duration.Inf) + } + } + +} + +object BindCanonicalAddressSpec { + val commonConfig = ConfigFactory.parseString(""" + akka { + actor.provider = remote + remote.artery.enabled = true + } + """) +} diff --git a/akka-remote/src/test/scala/akka/remote/artery/HandshakeFailureSpec.scala b/akka-remote/src/test/scala/akka/remote/artery/HandshakeFailureSpec.scala index 9910d72653..802f5a58f8 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/HandshakeFailureSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/HandshakeFailureSpec.scala @@ -21,13 +21,13 @@ object HandshakeFailureSpec { akka { actor.provider = remote remote.artery.enabled = on - remote.artery.hostname = localhost - remote.artery.port = 0 + remote.artery.canonical.hostname = localhost + remote.artery.canonical.port = 0 remote.artery.advanced.handshake-timeout = 2s } """) - val configB = ConfigFactory.parseString(s"akka.remote.artery.port = $portB") + val configB = ConfigFactory.parseString(s"akka.remote.artery.canonical.port = $portB") .withFallback(commonConfig) } diff --git a/akka-remote/src/test/scala/akka/remote/artery/HandshakeRetrySpec.scala b/akka-remote/src/test/scala/akka/remote/artery/HandshakeRetrySpec.scala index fa003aa628..3e8feadf59 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/HandshakeRetrySpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/HandshakeRetrySpec.scala @@ -20,14 +20,14 @@ object HandshakeRetrySpec { akka { actor.provider = remote remote.artery.enabled = on - remote.artery.hostname = localhost - remote.artery.port = 0 + remote.artery.canonical.hostname = localhost + remote.artery.canonical.port = 0 remote.handshake-timeout = 10s } """) - val configB = ConfigFactory.parseString(s"akka.remote.artery.port = $portB") + val configB = ConfigFactory.parseString(s"akka.remote.artery.canonical.port = $portB") .withFallback(commonConfig) } diff --git a/akka-remote/src/test/scala/akka/remote/artery/LateConnectSpec.scala b/akka-remote/src/test/scala/akka/remote/artery/LateConnectSpec.scala index edf74c2736..36f1690dd2 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/LateConnectSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/LateConnectSpec.scala @@ -21,8 +21,8 @@ object LateConnectSpec { akka { actor.provider = remote remote.artery.enabled = on - remote.artery.hostname = localhost - remote.artery.port = 0 + remote.artery.canonical.hostname = localhost + remote.artery.canonical.port = 0 remote.artery.advanced.handshake-timeout = 3s } """) @@ -32,7 +32,7 @@ object LateConnectSpec { class LateConnectSpec extends AkkaSpec(LateConnectSpec.config) with ImplicitSender { val portB = SocketUtil.temporaryServerAddress("localhost", udp = true).getPort - val configB = ConfigFactory.parseString(s"akka.remote.artery.port = $portB") + val configB = ConfigFactory.parseString(s"akka.remote.artery.canonical.port = $portB") .withFallback(system.settings.config) lazy val systemB = ActorSystem("systemB", configB) diff --git a/akka-remote/src/test/scala/akka/remote/artery/RemoteConnectionSpec.scala b/akka-remote/src/test/scala/akka/remote/artery/RemoteConnectionSpec.scala index 7ff1fad35c..8389797538 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/RemoteConnectionSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/RemoteConnectionSpec.scala @@ -34,7 +34,7 @@ class RemoteConnectionSpec extends ArteryMultiNodeSpec("akka.remote.retry-gate-c localProbe.expectNoMsg(1.seconds) // then start the remote system and try again - val remoteSystem = newRemoteSystem(extraConfig = Some(s"akka.remote.artery.port=$remotePort")) + val remoteSystem = newRemoteSystem(extraConfig = Some(s"akka.remote.artery.canonical.port=$remotePort")) muteSystem(remoteSystem) localProbe.expectNoMsg(2.seconds) @@ -65,7 +65,7 @@ class RemoteConnectionSpec extends ArteryMultiNodeSpec("akka.remote.retry-gate-c localProbe.expectNoMsg(1.seconds) // then when it is up, talk from other system - val remoteSystem = newRemoteSystem(extraConfig = Some(s"akka.remote.artery.port=$remotePort")) + val remoteSystem = newRemoteSystem(extraConfig = Some(s"akka.remote.artery.canonical.port=$remotePort")) muteSystem(remoteSystem) localProbe.expectNoMsg(2.seconds) @@ -82,4 +82,3 @@ class RemoteConnectionSpec extends ArteryMultiNodeSpec("akka.remote.retry-gate-c } } - diff --git a/akka-remote/src/test/scala/akka/remote/artery/RemoteDeathWatchSpec.scala b/akka-remote/src/test/scala/akka/remote/artery/RemoteDeathWatchSpec.scala index b070097412..635b73dc8e 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/RemoteDeathWatchSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/RemoteDeathWatchSpec.scala @@ -27,8 +27,8 @@ object RemoteDeathWatchSpec { } remote.watch-failure-detector.acceptable-heartbeat-pause = 3s remote.artery.enabled = on - remote.artery.hostname = localhost - remote.artery.port = 0 + remote.artery.canonical.hostname = localhost + remote.artery.canonical.port = 0 } """) } @@ -39,7 +39,7 @@ class RemoteDeathWatchSpec extends AkkaSpec(RemoteDeathWatchSpec.config) with Im system.eventStream.publish(TestEvent.Mute( EventFilter[io.aeron.exceptions.RegistrationException]())) - val other = ActorSystem("other", ConfigFactory.parseString(s"akka.remote.artery.port=$otherPort") + val other = ActorSystem("other", ConfigFactory.parseString(s"akka.remote.artery.canonical.port=$otherPort") .withFallback(system.settings.config)) override def afterTermination() { diff --git a/akka-remote/src/test/scala/akka/remote/artery/RemoteDeployerSpec.scala b/akka-remote/src/test/scala/akka/remote/artery/RemoteDeployerSpec.scala index 5c95b122e8..b4152ae111 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/RemoteDeployerSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/RemoteDeployerSpec.scala @@ -22,8 +22,8 @@ object RemoteDeployerSpec { } } akka.remote.artery.enabled = on - akka.remote.artery.hostname = localhost - akka.remote.artery.port = 0 + akka.remote.artery.canonical.hostname = localhost + akka.remote.artery.canonical.port = 0 """, ConfigParseOptions.defaults) class RecipeActor extends Actor { diff --git a/akka-remote/src/test/scala/akka/remote/artery/RemoteDeploymentSpec.scala b/akka-remote/src/test/scala/akka/remote/artery/RemoteDeploymentSpec.scala index 7189141f3d..90f89c3147 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/RemoteDeploymentSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/RemoteDeploymentSpec.scala @@ -36,8 +36,8 @@ class RemoteDeploymentSpec extends AkkaSpec(""" #akka.loglevel=DEBUG akka.actor.provider = remote akka.remote.artery.enabled = on - akka.remote.artery.hostname = localhost - akka.remote.artery.port = 0 + akka.remote.artery.canonical.hostname = localhost + akka.remote.artery.canonical.port = 0 """) { import RemoteDeploymentSpec._ diff --git a/akka-remote/src/test/scala/akka/remote/artery/RemoteRouterSpec.scala b/akka-remote/src/test/scala/akka/remote/artery/RemoteRouterSpec.scala index 00fbf374d6..80f133b7cc 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/RemoteRouterSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/RemoteRouterSpec.scala @@ -24,8 +24,8 @@ object RemoteRouterSpec { class RemoteRouterSpec extends AkkaSpec(""" akka.actor.provider = remote akka.remote.artery.enabled = on - akka.remote.artery.hostname = localhost - akka.remote.artery.port = 0 + akka.remote.artery.canonical.hostname = localhost + akka.remote.artery.canonical.port = 0 akka.actor.deployment { /remote-override { router = round-robin-pool diff --git a/akka-remote/src/test/scala/akka/remote/artery/RemoteSendConsistencySpec.scala b/akka-remote/src/test/scala/akka/remote/artery/RemoteSendConsistencySpec.scala index da8b7bea11..fd874fc152 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/RemoteSendConsistencySpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/RemoteSendConsistencySpec.scala @@ -21,8 +21,8 @@ object RemoteSendConsistencySpec { akka { actor.provider = remote remote.artery.enabled = on - remote.artery.hostname = localhost - remote.artery.port = 0 + remote.artery.canonical.hostname = localhost + remote.artery.canonical.port = 0 } """) diff --git a/akka-remote/src/test/scala/akka/remote/artery/RemoteWatcherSpec.scala b/akka-remote/src/test/scala/akka/remote/artery/RemoteWatcherSpec.scala index 3267448214..db5d67ff6b 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/RemoteWatcherSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/RemoteWatcherSpec.scala @@ -69,8 +69,8 @@ class RemoteWatcherSpec extends AkkaSpec( log-dead-letters-during-shutdown = false actor.provider = remote remote.artery.enabled = on - remote.artery.hostname = localhost - remote.artery.port = 0 + remote.artery.canonical.hostname = localhost + remote.artery.canonical.port = 0 }""") with ImplicitSender { import RemoteWatcherSpec._ diff --git a/akka-remote/src/test/scala/akka/remote/artery/SerializationErrorSpec.scala b/akka-remote/src/test/scala/akka/remote/artery/SerializationErrorSpec.scala index a555c51fc6..63b19320d4 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/SerializationErrorSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/SerializationErrorSpec.scala @@ -17,8 +17,8 @@ object SerializationErrorSpec { akka { actor.provider = remote remote.artery.enabled = on - remote.artery.hostname = localhost - remote.artery.port = 0 + remote.artery.canonical.hostname = localhost + remote.artery.canonical.port = 0 actor { serialize-creators = false serialize-messages = false diff --git a/akka-remote/src/test/scala/akka/remote/artery/SystemMessageDeliverySpec.scala b/akka-remote/src/test/scala/akka/remote/artery/SystemMessageDeliverySpec.scala index 624acf337a..3ad664f708 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/SystemMessageDeliverySpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/SystemMessageDeliverySpec.scala @@ -38,8 +38,8 @@ object SystemMessageDeliverySpec { akka { actor.provider = remote remote.artery.enabled = on - remote.artery.hostname = localhost - remote.artery.port = 0 + remote.artery.canonical.hostname = localhost + remote.artery.canonical.port = 0 } akka.actor.serialize-creators = off akka.actor.serialize-messages = off diff --git a/akka-remote/src/test/scala/akka/remote/artery/UntrustedSpec.scala b/akka-remote/src/test/scala/akka/remote/artery/UntrustedSpec.scala index 837ffd7dbe..7963b8f025 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/UntrustedSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/UntrustedSpec.scala @@ -65,8 +65,8 @@ class UntrustedSpec extends AkkaSpec(""" akka.remote.untrusted-mode = on akka.remote.trusted-selection-paths = ["/user/receptionist", ] akka.remote.artery.enabled = on - akka.remote.artery.hostname = localhost - akka.remote.artery.port = 0 + akka.remote.artery.canonical.hostname = localhost + akka.remote.artery.canonical.port = 0 akka.loglevel = DEBUG # the test is verifying some Debug logging """) with ImplicitSender { @@ -75,8 +75,8 @@ class UntrustedSpec extends AkkaSpec(""" val client = ActorSystem("UntrustedSpec-client", ConfigFactory.parseString(""" akka.actor.provider = remote akka.remote.artery.enabled = on - akka.remote.artery.hostname = localhost - akka.remote.artery.port = 0 + akka.remote.artery.canonical.hostname = localhost + akka.remote.artery.canonical.port = 0 """)) val addr = RARP(system).provider.getDefaultAddress diff --git a/akka-remote/src/test/scala/akka/remote/artery/compress/CompressionIntegrationSpec.scala b/akka-remote/src/test/scala/akka/remote/artery/compress/CompressionIntegrationSpec.scala index e3d479c7fa..47f7523603 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/compress/CompressionIntegrationSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/compress/CompressionIntegrationSpec.scala @@ -17,7 +17,7 @@ object CompressionIntegrationSpec { actor { provider = "akka.remote.RemoteActorRefProvider" - + serializers { test-message = "akka.remote.artery.compress.TestMessageSerializer" } @@ -26,8 +26,8 @@ object CompressionIntegrationSpec { } } remote.artery.enabled = on - remote.artery.hostname = localhost - remote.artery.port = 0 + remote.artery.canonical.hostname = localhost + remote.artery.canonical.port = 0 remote.artery.advanced.handshake-timeout = 10s remote.artery.advanced.compression { @@ -38,6 +38,6 @@ object CompressionIntegrationSpec { } """) - val configB = ConfigFactory.parseString(s"akka.remote.artery.port = $portB") + val configB = ConfigFactory.parseString(s"akka.remote.artery.canonical.port = $portB") .withFallback(commonConfig) } diff --git a/akka-remote/src/test/scala/akka/remote/artery/compress/HandshakeShouldDropCompressionTableSpec.scala b/akka-remote/src/test/scala/akka/remote/artery/compress/HandshakeShouldDropCompressionTableSpec.scala index 55433ae0f1..4cf2c69646 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/compress/HandshakeShouldDropCompressionTableSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/compress/HandshakeShouldDropCompressionTableSpec.scala @@ -28,8 +28,8 @@ object HandshakeShouldDropCompressionTableSpec { actor.provider = "akka.remote.RemoteActorRefProvider" remote.artery.enabled = on - remote.artery.hostname = localhost - remote.artery.port = 0 + remote.artery.canonical.hostname = localhost + remote.artery.canonical.port = 0 remote.artery.advanced.handshake-timeout = 10s remote.artery.advanced.compression { @@ -41,7 +41,7 @@ object HandshakeShouldDropCompressionTableSpec { } """) - val configB = ConfigFactory.parseString(s"akka.remote.artery.port = $portB") + val configB = ConfigFactory.parseString(s"akka.remote.artery.canonical.port = $portB") .withFallback(commonConfig) } @@ -149,4 +149,3 @@ class HandshakeShouldDropCompressionTableSpec extends AkkaSpec(HandshakeShouldDr if (systemB != null) shutdown(systemB) } } -