Thank you Alex - a very good answer :-) 

After my post, I of course went and created the Macro way anyway because I 
liked the problem a bit .. stretches the skills. It didn't take long to 
write and prove.

So here is - case class macro copier() for a sealed abstract class..

https://gist.github.com/rbuckland/11229137

The nice part ..  is that I can call 

MessageEnricher.enrich(cmd,account.id,clientHost)

and it will dutifully call 

cmd.copy(...) 

for me. ( I have currently in this code base 200+ commands, so I was not 
going to hand carve any of that - DRY )

Future googlers foo : "How can I call the case class copy() from the Super 
Class for any case class ?" ) <-- might SO that I think.

r.

On Wednesday, 23 April 2014 11:44:05 UTC+1, ahjohannessen wrote:
>
> You could use a correlationId on your commands and events, and then store 
> metadata in some other place along with the correlationId before entering 
> the domain.
>
>>
>>

-- 
>>>>>>>>>>      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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to