Hi, I am using Akka in Java (and quite new to it). I want to decorate my actor events and event processing so that I can achieve things like traceability.
One thought I had on doing this involves having all sent actor events contain a context, which is always passed around with any subsequent events, and enriched (immutably) with data useful for implementing opentracing concepts such as timings, etc.. This would be handled transparently somehow by extending the framework. For example, when an event is handled, the actor's current ctx would be set to the event's ctx, and any subsequent outbound event would be automatically decorated with the ctx. I could also use this to set MDC with the ctx values which would let me log with things like traceId / requestId. Assuming this is a reasonable thing to do, I was trying to understand what would be needed to achieve this. An approach might be to extend AbstractActor, and have things like receiveBuilder return a decorated RecieveBuilder, which would in turn decorate the match handlers. However, receiveBuilder is final so cannot do that. (What's the reason for it?). I imagine it might also require decorating other things like ActorRef to decorate the events with context... Any thoughts on how to achieve this? Am entirely open to other avenues I may be blind or naive to! One constraint is that I am tied to using the Java api with Akka, but can pull in open source Scala libraries so long as I can use them in Java without the need to use Scala. Thanks, daz -- >>>>>>>>>> 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
