Command enrichment with Lagom



The scenario is that in my service implementation, I’m calling multiple database queries that return Future[X]
Then I have some logic which combines these futures, and I use the combined result to enrich a command sent to lagom.

Question: As far as I know PersistenceEntity cannot receive a Future. Is the only way to block then with Await.result before sending the actual command? (not very nice)

(Alan Klikic) #2

@gabox01 command is sent to entity via PersistentEntityRef.ask that returns a future. So you need to chain it with enrichment future.