On Sat, Feb 22, 2014 at 1:03 AM, Richard Rodseth <[email protected]> wrote:

> Another bit of feedback.
>
> Is there a way to inject the "listing" ActorRef into Post, or include it
> in a message, so that the Post code is not cluster-aware?
>

That is a very good suggestion. Add the listing: ActorRef as constructor
parameter, and specify it in the entryProps when starting the region.

      ClusterSharding(system).start(
        typeName = Post.shardName,
        entryProps = Some(Props(classOf[Post],
ClusterSharding(system).shardRegion(AuthorListing.shardName))),
        idExtractor = Post.idExtractor,
        shardResolver = Post.shardResolver)

AuthorListing must be be started first.

Thank you for the feedback.

Regards,
Patrik


>
>
> On Fri, Feb 21, 2014 at 3:19 PM, Richard Rodseth <[email protected]>wrote:
>
>> Hi Patrik
>>
>> I should have just said "different". I'm not saying your design is wrong.
>> But you must admit that much of the design guidance that is offered for
>> actors says "think of an actor as a person". And certainly in a traditional
>> DDD app your aggregates aren't these autonomous things operating
>> concurrently. Now we have entities as actors, and with the clustered
>> sharding the "factory" as well as the supervision is all behind the scenes
>> (apparently). I'm confident it's going to be a great way to build apps -
>> just going through a learning process.  Keep up the good work.
>>
>>
>> On Fri, Feb 21, 2014 at 2:54 PM, Patrik Nordwall <
>> [email protected]> wrote:
>>
>>> Hi,
>>>
>>> On Fri, Feb 21, 2014 at 10:42 PM, Richard Rodseth <[email protected]>wrote:
>>>
>>>> I have now read the sharding documentation, and this in the template.
>>>> Sorry I jumped the gun in my excitement :)
>>>> >>
>>>> To send messages to the identifier of the Post actor you need to send
>>>> them via the shardRegion actor, which can be retrieved via the
>>>> ClusterSharding extension. The sharding feature knows how to route the
>>>> message and it will on demand allocate the Post actors to cluster
>>>> nodes and create the actor instances. Exactly how this works under the hood
>>>> is described in the 
>>>> documentation<http://doc.akka.io/docs/akka/2.3.0-RC4/contrib/cluster-sharding.html>
>>>> .
>>>> <<
>>>> It still feels a bit weird to think of actors as "entries" rather than
>>>> workers.
>>>>
>>>>
>>> Thanks for trying the new activator template [1].
>>>
>>> Weird? For me, an actor can be a consistency boundary with a meaningful
>>> identity and continuity through a life cycle, i.e. an Entity or Aggregate.
>>>
>>> Not all actors are like that of course, others are workers, services, ...
>>>
>>> /Patrik
>>>
>>> [1] http://typesafe.com/activator/template/akka-cluster-sharding-scala
>>>
>>>
>>>>
>>>>
>>>> On Fri, Feb 21, 2014 at 12:28 PM, Richard Rodseth 
>>>> <[email protected]>wrote:
>>>>
>>>>> I'm excited to see the new cluster-sharding activator template, which
>>>>> I think might address some of the confusion I've had about eventsourced 
>>>>> DDD
>>>>> with an actor per aggregate root.
>>>>>
>>>>> Do I understand correctly that the actual instantiation of the Post
>>>>> processor actor is something that happens within the ClusterSharding
>>>>> pattern (which I confess I haven't studied yet). Perhaps that could be
>>>>> called out in the text.
>>>>>
>>>>> Is it fair to say the the actor-per-aggregate root approach *presumes*
>>>>> a memory image model which then implies sharding and hence the use of Akka
>>>>> cluster?
>>>>>
>>>>> Is there or will there be a non-clustered version of the same app?
>>>>> That might be instructive for those of us trying to wrap our heads around
>>>>> DDD, Event Sourcing, CQRS and Akka all at once :)
>>>>>
>>>>> I look forward to digging in further, but obviously have a lot to
>>>>> learn. Thanks for the template!
>>>>>
>>>>
>>>>  --
>>>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>>>> >>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>> >>>>>>>>>> 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 http://groups.google.com/group/akka-user.
>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>
>>>
>>>
>>>
>>> --
>>>
>>> Patrik Nordwall
>>> Typesafe <http://typesafe.com/> -  Reactive apps on the JVM
>>> Twitter: @patriknw
>>>
>>>  --
>>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>>> >>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>> >>>>>>>>>> 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 http://groups.google.com/group/akka-user.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>
>  --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ: http://akka.io/faq/
> >>>>>>>>>> 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 http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 

Patrik Nordwall
Typesafe <http://typesafe.com/> -  Reactive apps on the JVM
Twitter: @patriknw

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: http://akka.io/faq/
>>>>>>>>>>      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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to