Hi Luis,

On Tue, May 20, 2014 at 2:58 AM, Luis Medina <lu4...@gmail.com> wrote:

> Thank you for the help Martynas. Got a couple of follow-up questions:
>
>
>> Cluster singleton is always created on the oldest node in the cluster
>> with a specified role if any. This implies that there could a resource
>> bottleneck on the oldest node.
>
>
> 1. Is there any way to define a different strategy that creates singletons
> in a random node similar to how you can configure a different strategy for
> the ShardCoordinator when allocating new shards?
>

This is not currently supported by a ClusterSingletonManager. Sharding
solves this particular issue.


>
> 2. In distributed PubSub, when I publish a message from actor (a), will
> subscribers who receive the message know that it came from actor (a)? Or is
> this information lost?
>

Yes. The sender is still there and can be used as it is in clustering
pubsub activator
template<https://github.com/typesafehub/activator-akka-clustering/blob/master/src/main/scala/chat/ChatClient.scala#L27>
.


>
> 3. If I subscribe a round-robin cluster-aware pool router to a particular
> topic using cluster PubSub, will the round-robinness still hold for the
> messages that are sent to it?
>
> I'm thinking this would probably look something like this in code:
>
> //configuration
> akka.actor.deployment {
>   /master/worker {
>     router = round-robin-pool
>
>     nr-of-instances = 10
>     cluster {
>       enabled = on
>     }
>   }
> }
>
> //code
> ActorRef router =
> getContext().actorOf(FromConfig.getInstance().props(Props.create(Worker.class)),
> "worker");
>
> ActorRef mediator =
> DistributedPubSubExtension.get(getContext().system()).mediator();
> mediator.tell(new DistributedPubSubMediator.Subscribe("topic", router),
> router);
>

Yes. This will work. Router has an ordinary Actor Path which can be used to
subscribe to a topics in PubSub.


>
> 4. In the distributed PubSub documentation page (
> http://doc.akka.io/docs/akka/2.3.2/contrib/distributed-pub-sub.html#distributed-pub-sub)
> at the bottom, they explain the different configurations for this feature.
>   a. What units of time can be specified for the "gossip-interval"? In the
> example they use seconds but can you do milliseconds?
>

Yes. It can be specified in ms. However the smaller the value, the more
traffic you are going to get in the cluster, especially in cases when there
are lots of new/old subscriptions.


>   b. I'm a little unclear as to what "max-delta-elements" is used for. It
> says that it's the max. number of elements to be transfered in one message
> when the registry is synchronized. Where are these elements being moved
> to/from? Also, what is the distinction between elements and message?
>

This is a setting for the pub-sub gossip protocol. In this case elements
are subscriptions to some particular topic or path that Mediator actors
keep track of. This data is exchanged between Mediator actors.


>
> 5. In distributed PubSub, if I were to publish a message to a topic that
> has no subscribers, will the message simply get dropped since it couldn't
> find anyone to send it to, or does it get queued somewhere until someone
> subscribes to that topic?
>

Messages would simply be dropped.


>
> 6. Is it possible to use a ClusterClient together with distributed PubSub
> to subscribe to a particular topic from an actor that is outside of the
> cluster?
>

This is not currently supported.

As a side node, it could be used the other way around. In fact
ClusterReceptionist that ClusterClient talks to, is itself built on PubSub.


>
> They are even more loosely coupled, the messages are sent to the defined
>> path, i.e. using ActorSelection. There is no identification process. That
>> means that the target actors can be started after the router, or stopped
>> and started again, and still participate in the router. Messages will be
>> delivered to deadLetters when the actor of the target path does not exist.
>
>
> Good to know! Thanks Patrik.
>
> --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> –
Reactive<http://www.reactivemanifesto.org/>Apps on the JVM

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