On Tue, Jun 23, 2015 at 8:06 AM, Kostas kougios <
kostas.koug...@googlemail.com> wrote:

> 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)
>

What is your definition of before, here?
The registry of subscribers is eventually consistent, i.e. changes are not
immediately visible at other nodes, but typically they will be fully
replicated to all other nodes after a few seconds.

/Patrik


>
> 2. The actors context.system are different (akka - cluster) but the rest
> of the cluster communicates fine.
>
> 3. all run under a testcase in the same jvm
>
> Here is my config:
>
> akka {
>   log-dead-letters-during-shutdown = off
>   loglevel = "INFO"
>   cluster {
>     gossip-interval = 100 ms
>     leader-actions-interval = 100 ms
>     seed-nodes = [
>       "akka.tcp://testSystem@127.0.0.1:2700",
>       "akka.tcp://testSystem@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"]
>     }
>   }
> }
>
>
>  --
> >>>>>>>>>> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@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 <http://typesafe.com/> -  Reactive apps on the JVM
Twitter: @patriknw

-- 
>>>>>>>>>>      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+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to