Hi,
I have a Akka cluster setup locally on one machine, with 2 nodes running on
2 java processes participating into one cluster. The different java
processes (nodes) listen on different TCP ports.
I am able to startup and see the nodes joining the cluster, however, when I
have the "orchestrator" node "DistributedPubSubMediator.Send" a message to
the "mediator" actor, the target remote actor never received the message.
Can anyone help give some pointers on how to trouble shoot such issue?
Attaching the akka application.conf. The highlights:
actor.provider = "akka.cluster.ClusterActorRefProvider"
remote {
enabled-transports = ["akka.remote.netty.tcp"]
netty.tcp {
hostname = 127.0.0.1
port = 9095
}
}
extensions = ["akka.cluster.pubsub.DistributedPubSub"]
For the 2 nodes, one runs on port *9095*, and one runs on port *9080*
>From the log:
[INFO] [07/22/2016 13:42:40.024] [main] [akka.remote.Remoting] Starting
remoting
[INFO] [07/22/2016 13:42:40.305] [main] [akka.remote.Remoting] Remoting
started; listening on addresses :[akka.tcp://[email protected]:9095]
[INFO] [07/22/2016 13:42:40.306] [main] [akka.remote.Remoting] Remoting now
listens on addresses: [akka.tcp://[email protected]:9095]
[INFO] [07/22/2016 13:42:40.317] [main]
[akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node
[akka.tcp://[email protected]:9095] - Starting up...
[INFO] [07/22/2016 13:42:40.390] [main]
[akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node
[akka.tcp://[email protected]:9095] - Registered cluster JMX MBean
[akka:type=Cluster]
[INFO] [07/22/2016 13:42:40.390] [main]
[akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node
[akka.tcp://[email protected]:9095] - Started up successfully
[INFO] [07/22/2016 13:42:45.442]
[ClusterSystem-akka.actor.default-dispatcher-15]
[akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node
[akka.tcp://[email protected]:9095] - Node
[akka.tcp://[email protected]:9095] is JOINING, roles [fitting]
[INFO] [07/22/2016 13:42:46.426]
[ClusterSystem-akka.actor.default-dispatcher-16]
[akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node
[akka.tcp://[email protected]:9095] - Leader is moving node
*[akka.tcp://[email protected]:9095]
to [Up]*
[INFO] [07/22/2016 13:42:49.604]
[ClusterSystem-akka.actor.default-dispatcher-19]
[akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node
[akka.tcp://[email protected]:9095] - Node
[akka.tcp://[email protected]:9080] is JOINING, roles [fitting]
[INFO] [07/22/2016 13:42:50.420]
[ClusterSystem-akka.actor.default-dispatcher-14]
[akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node
[akka.tcp://[email protected]:9095] - Leader is moving node
*[akka.tcp://[email protected]:9080]
to [Up]*
Node membership in the cluster looks fine, but the message sending is not
successful.
Code sending to remote actor with path "worker"
private ActorRef mediator =
DistributedPubSub.get(getContext().system()).mediator();
boolean localAffinity = true;
mediator.tell(new DistributedPubSubMediator.Send("/user/*worker*",
message, localAffinity), getSelf());
Code worker actor telling itself to mediator
actorSystem.actorOf(Props.create(FittingActor.class), "worker");
ActorRef mediator =
DistributedPubSub.get(getContext().system()).mediator();
// register to the path
mediator.tell(new DistributedPubSubMediator.Put(getSelf()),
getSelf());
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.
akka {
actor.provider = "akka.cluster.ClusterActorRefProvider"
loglevel = INFO
remote {
enabled-transports = ["akka.remote.netty.tcp"]
netty.tcp {
hostname = 127.0.0.1
port = 9095
}
log-remote-lifecycle-events = on
log-sent-messages = on
log-received-messages = on
transport-failure-detector {
hartbeat-interval = 30s
}
}
cluster {
roles = ["fitting"]
metrics.enabled = off
auto-down-unreachable-after = 120s
seed-nodes = [
"akka.tcp://[email protected]:9095",
"akka.tcp://[email protected]:9080"
]
pub-sub {
# Actor name of the mediator actor, /system/distributedPubSubMediator
name = distributedPubSubMediator
# Start the mediator on members tagged with this role.
# All members are used if undefined or empty.
role = ""
# The routing logic to use for 'Send'
# Possible values: random, round-robin, broadcast
routing-logic = random
# How often the DistributedPubSubMediator should send out gossip
information
gossip-interval = 1s
# Removed entries are pruned after this duration
removed-time-to-live = 120s
# Maximum number of elements to transfer in one message when
synchronizing the registries.
# Next chunk will be transferred in next round of gossip.
max-delta-elements = 3000
# The id of the dispatcher to use for DistributedPubSubMediator actors.
# If not specified default dispatcher is used.
# If specified you need to define the settings of the actual dispatcher.
use-dispatcher = ""
}
}
extensions = ["akka.cluster.pubsub.DistributedPubSub"]
}