private val mediator = DistributedPubSubExtension(system).mediator
mediator ! Subscribe(Subscriptions.IndexActorAvailability, self)
override def receive = {
case SubscribeAck(subscribe) =>
context become ready
...
private val mediator = DistributedPubSubExtension(context.system).mediator
mediator ! Publish(Subscriptions.IndexActorAvailability, IAmAvailable(index, self))
akka {
log-dead-letters-during-shutdown = off
loglevel = "INFO"
cluster {
gossip-interval = 100 ms
leader-actions-interval = 100 ms
seed-nodes = [
"akka.tcp://testS...@127.0.0.1:2700",
"akka.tcp://testS...@127.0.0.1:2701"
]
}
extensions = ["akka.contrib.pattern.DistributedPubSubExtension"]
}
server1 {
akka {
remote {
netty.tcp {
port = 2700
}
}
cluster {
roles = ["index-server"]
}
}
}
server2 {
akka {
remote {
netty.tcp {
port = 2701
}
}
cluster {
roles = ["index-server"]
}
}
}
driver {
akka {
remote {
netty.tcp {
port = 2702
}
}
cluster {
roles = ["driver"]
}
}
}
Hi, using akka cluster and DistributedPubSubExtension, I am creating a topic.
The receiving actor (driver) subscribes to the topic:private val mediator = DistributedPubSubExtension(system).mediator
mediator ! Subscribe(Subscriptions.IndexActorAvailability, self)override def receive = {
case SubscribeAck(subscribe) =>
context become ready
...
The publishing actor (server) publishes a msg during it's startup:private val mediator = DistributedPubSubExtension(context.system).mediator
mediator ! Publish(Subscriptions.IndexActorAvailability, IAmAvailable(index, self))
But the driver actor never receives it.
Some notes:
1. "context become ready" is certainly executed before the publishing actor publishes the msg (I've debugged it)
--
>>>>>>>>>> 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 akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.
Patrik Nordwall
Typesafe - Reactive apps on the JVM
Twitter: @patriknw
awaitCond( cluster1.state.members.size == 3 && cluster2.state.members.size == 3 && driverCluster.state.members.size == 3, 60 seconds ) Thread.sleep(2000)
You received this message because you are subscribed to a topic in the Google Groups "Akka User List" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/akka-user/PHVO7ueaNrU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to akka-user+...@googlegroups.com.
akka.contrib.cluster.pub-sub.gossip-interval
Thanks, gossip-interval works, but also tried 2.4-M1. I get a compilation error that DistributedPubSubExtension is not found and can't find DistributedPubSubExtension class in those deps:
http://search.maven.org/#search|ga|1|c%3A%22DistributedPubSubExtension%22