I forgot to remove this comment earlier. Akka did exposed a public API for getting the port which is `getDefaultAddress`. earlier this code use to be like this 

val provider = actorSystem.asInstanceOf[ExtendedActorSystem].provider
    val boundPort = provider.asInstanceOf[RemoteActorRefProvider].transport.address.port.get