I'm not really sure I understand. If akka-persistence has to choose, prior 
to persistence to a journal, a sequence number to associate with a payload, 
it's surely, to some degree, a nuance of the API design that prevents me 
knowing, in my implementation, what that sequence number would be? Whether 
the sequence number is available within my payload, or as part of the 
actual serialised object (PersistentRepr) that wraps my custom payload, I 
can't see how it changes the fact that the sequence number must be 
explicitly passed to the journal.

If I'm missing the point, I'd appreciate learning where the limitation 
exists in my understanding.


On Sunday, 22 December 2013 12:23:20 UTC, √ wrote:
>
> That precludes distributed event generation.
> On Dec 22, 2013 6:13 PM, "Andrew Easter" <[email protected]<javascript:>> 
> wrote:
>
>> Hi Martin/others,
>>
>> When using EventsourcedProcessor, whilst the underlying persistence 
>> mechanism will associate a sequence number with any event persisted, I 
>> still see some value in being able to persist the sequence number within 
>> the custom event payload. For example, say I have an event payload such as: 
>>
>> case class Event(id: UUID, correlationId: UUID, sequenceNumber: Long, 
>> data: Any)
>>
>> - id = the unique id of an aggregate root
>> - correlationId = the correlation id of the command that was executed to 
>> spawn the event
>> - sequenceNumber - the sequence number of the event for the given 
>> aggregate root
>> - data - the internal payload which would vary depending on actual event 
>> that has occurred in the system (e.g. CustomerCreated)
>>
>> Using EventsourcedProcessor, I'd like to pass such a representation to 
>> the persist(...) method. However, at that point, the only way I can 
>> determine what sequence number will be persisted with an event is to take 
>> the current sequence number and increment by 1 - if I am persisting 
>> multiple events, I'll have to increment by 2, 3, 4 etc. 
>>
>> I am okay to anticipate the sequence numbers prior to persistence? Also, 
>> do you think I'm being unnecessarily pedantic to want to keep everything 
>> related to an event within my own payload?
>>
>> Thanks,
>>
>> Andrew
>>
>> -- 
>> >>>>>>>>>> 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] <javascript:>.
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>

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