Hi Roland,

Thanks for the answer,

On Thu, 2014-02-13 at 12:58 +0100, Roland Kuhn wrote:
> Hi Brice,
> 
> when sending a wrapped message to a destination, then that destination
> must know how to open the envelope, otherwise the message will be
> lost. I think that this principle applies universally, which explains
> why extra wrapping means extra unwrapping in unaware components like
> the TestActor.

Yes, I understand completely the problem. I thought I could inherit from
TestKitBase and just override the creation of the test actor so that it
could unwrap. Except that it's impossible because the test actor uses
private/internal components of akka. Some other private members also
makes this job impossible. It's not even possible to fork completely
TestKit :(

> Concerning your meta-data comment: the things you allude to would
> really be incredible, since it would be rather hard to formulate sane
> semantics for them. For example if you send a message with some
> attached meta-data to someone and expect the reply to still contain
> the meta-data (because the recipient was not supposed to know about it
> in the first place), then how do you suppose that meta-data should be
> picked up by ActorRef.tell()? Given a hypothetical solution to this
> problem, how would you merge conflicting meta-data? How would you
> reason about the size of messages which you send to remote
> destinations, if another actor can just smuggle a few GB of movie
> streams into it? How do you distinguish between sending “unrelated”
> messages and replies, i.e. where are meta-data kept and where not?

Well, I was more thinking about something along the line of the 'sender'
mechanism or the new akka 2.3 MDC system. The actor would offer an
implicit hash that could be filled with envelope metadata of the current
message. The actor would allow to modify those user metadata and when
'tell' would be used the current value of the hash would form the new
envelope user metadata for the next actor (exactly like sender in
fact). 

Of course your concern about message size is still valid and applies.
I'd consider this as a power-user feature.

And finally to answer the related replies, only the current actor logic
can decide the metadata are valid or not. In my view this is perfectly
fine and would allow to build message tracking systems (ala zipkin or
google dapper) effortless.

Of course, I'm seeing only my view of the problem and I certainly don't
have all the necessary inputs to judge if it fits in Akka or not :)

> The only sane solution is to be explicit about this, which is
> precisely what Akka forces you to do.

Yes, and that's the reason I was doing it in my own library, but that
makes the code cumbersome to deal with, especially when it comes to
testing, where you want to focus on the actor logic and your test
becomes polluted by internal details of the transport.

Anyway many thanks for the answer (and akka too)!
-- 
Brice Figureau
My Blog: http://www.masterzen.fr/

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