I am using Akka 2.6.9 version in Java project. Project consist of multiple modules having port 2551 for 1st module and 2552 port for 2nd module with a common hostname(localaddress) and fetching the values dynamically like below in application.conf
akka {
actor {
provider = remote
}
remote {
artery {
enabled = on
canonical.hostname = ${hostname}
canonical.port = ${port}
}
}
}
Logs:
[ArteryTcpTransport (akka://sys)] Remoting started with transport [Artery tcp]; listening on address [akka://sys@127.0.0.0.1:25520] with UID [6678542467887787]
Problem: On starting both the modules it is always listening on the port 25520 not taking 2551 or 2552. Because of this One module starts fine but I am getting address already in use Exception for the other module.
Both the modules have been started.
When sending message to the destination address it is showing below Handshake exception
InboundHandshake$$anon$2(akka://module2)
"Dropping Handshake Request from [{akka://module1}] addressed to unknown local address [{akka://module2}]. " +
"Local address is [{akka://module2}]. Check that the sending system uses the same " +
"address to contact recipient system as defined in the " +
"‘akka.remote.artery.canonical.hostname’ of the recipient system. " +
“The name of the ActorSystem must also match.”,