# Akka 2.6.9 Artery Implementation listening on default port always i.e. 25502

**URL:** <https://discuss.akka.io/t/akka-2-6-9-artery-implementation-listening-on-default-port-always-i-e-25502/7405>\
**Category:** Akka Cluster\
**Created:** [October 31, 2020, 12:28pm UTC](https://discuss.akka.io/t/akka-2-6-9-artery-implementation-listening-on-default-port-always-i-e-25502/7405 "2020-10-31T12:28:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sayonara](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@sayonara](https://discuss.akka.io/u/sayonara)\
**Post date:** [October 31, 2020, 12:28pm UTC](https://discuss.akka.io/t/akka-2-6-9-artery-implementation-listening-on-default-port-always-i-e-25502/7405/1 "2020-10-31T12:28:31Z")

</div>

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

1. akka {
2. actor {
3. provider = remote
4. }
5. remote {
6. artery {
7. enabled = on
8. canonical.hostname = ${hostname}
9. canonical.port = ${port}
10. }
11. }
12. }  
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.

Can anyone please help?

---

<div class="post-metadata">

**Author:** ![patriknw](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/patriknw/32/89_2.png) [@patriknw](https://discuss.akka.io/u/patriknw)\
**Post date:** [October 31, 2020, 8:05pm UTC](https://discuss.akka.io/t/akka-2-6-9-artery-implementation-listening-on-default-port-always-i-e-25502/7405/2 "2020-10-31T20:05:50Z")

</div>

How do you assign the `${port}`?  
One way would be to start java with `-Dakka.remote.artery.canonical.port=2552`

---

<div class="post-metadata">

**Author:** ![sayonara](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@sayonara](https://discuss.akka.io/u/sayonara)\
**Post date:** [November 2, 2020, 10:24am UTC](https://discuss.akka.io/t/akka-2-6-9-artery-implementation-listening-on-default-port-always-i-e-25502/7405/4 "2020-11-02T10:24:53Z")

</div>

Thanks its working now.

---

<div class="post-metadata">

**Author:** ![sayonara](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@sayonara](https://discuss.akka.io/u/sayonara)\
**Post date:** [November 2, 2020, 10:29am UTC](https://discuss.akka.io/t/akka-2-6-9-artery-implementation-listening-on-default-port-always-i-e-25502/7405/5 "2020-11-02T10:29:04Z")

</div>

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.”,

Could you please suggest?
