Hi michael,

On 06.02.14 14:50, delasoul wrote:
Hello Martin,

I have some other questions related to Channel usage in akka-persistence:
In eventsourced a channel and its destination where "married" when creating the channel:

val channel = extension.channelOf(DefaultChannelProps(channelId, destination))

Why has this changed for akka-persistence?
I guess in most cases the channel - destination relationship will never change, so which advantages do you see adding the
destination to the Deliver case class?

The main reason is to support reply to senders via channels. Senders may be different for each received messages and you don't want to create a new channel for each reply.

Also, if I share channels between actors (e.g.: there is an actor per account) I have to now find a way to say this channel has this destination - like constructing the AccountActor with a Map(channelActorRef -> destinationActorRef), which was like inbuildt with eventsourced.

You still can encapsulate a channel-destination pair inside a special-purpose actor and share that actor across your processors


Another question is why the Deliver message needs an ActorPath?

Reliable delivery by a channel means that we may potentially have to re-deliver a message to another incarnation of a destination actor compared to the initial delivery attempt (for example, to recover a conversation between two local processors after a JVM crash). This is made explicit in the API by using an actor path instead of a actor ref (where the latter is incarnation-specific).

The receive in the ReliableDelivery class calls context.actorSelection with the destination ActorPath - to get the ActorPath I need an ActorRef

there is ActorPath.fromString(...)

Cheers,
Martin

- so I already have the ActorRef in hand
- what's the advantage to still use the ActorPath and what is the advantage of using actorSelection(path: ActorPath) over using actorSelection(path: String). If I would use actorselection in my emitting actor to "lookup" a destination, in the moment I have to get the ActorRef for the actorSelection to send it a Deliver message.

Thanks in advance for your answers,

michael





On Thursday, 6 February 2014 07:43:12 UTC+1, Martin Krasser wrote:

    Hi Brian,

    On 06.02.14 01:01, Brian McDevitt wrote:
    > When using a Channel actor from the persistence package, is it
    > possible/expected to inhibit delivery of replayed messages when
    sent
    > from the child of a Processor?
    >
    > example:
    > ProcessorA receives a persistent message and passes that message
    off
    > to a child actor, the child actor then sends a new message (but
    uses
    > the persistent.withPayload()) to a destination via channel.

    Yes, this will work. Example: http://pastebin.com/jQYDPAh1

    >
    > I'm seeing replayed messages in the destination when I expected
    to see
    > none.  Am I misusing Channel?

    - Are you confirming delivery of messages in the destination?
    - Do you give your example app enough time to asynchronously write
    the
    confirmation to the journal?

    >
    > Cheers,
    > Brian
    > --
    > >>>>>>>>>> Read the docs: http://akka.io/docs/
    > >>>>>>>>>> Check the FAQ: http://akka.io/faq/
    > >>>>>>>>>> Search the archives:
    https://groups.google.com/group/akka-user
    <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] <javascript:>.
    > To post to this group, send email to [email protected]
    <javascript:>.
    > Visit this group at http://groups.google.com/group/akka-user
    <http://groups.google.com/group/akka-user>.
    > For more options, visit https://groups.google.com/groups/opt_out
    <https://groups.google.com/groups/opt_out>.

-- Martin Krasser

    blog: http://krasserm.blogspot.com
    code: http://github.com/krasserm
    twitter: http://twitter.com/mrt1nz


--
Martin Krasser

blog:    http://krasserm.blogspot.com
code:    http://github.com/krasserm
twitter: http://twitter.com/mrt1nz

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