Closed twe4ked closed 7 years ago
Based on the Buildkite agent tags we're running Postgresql 9.3 (postgresql=9.3
). Sounds like JSONB support was added in 9.4 so we will need to upgrade if we want to test with JSONB.
I know of a few Event Sourcery applications with reactors that emit events via commands/aggregates. How can we support this use case?
I know of a few Event Sourcery applications that emit events via commands/aggregates. How can we support this use case?
@orien I may be misunderstanding but unless they're doing that in reaction to an event I don't think this applies.
@twe4ked I had edited that comment to be more clear. But I mean exactly that, from a Reactor.
I know of a few Event Sourcery applications with reactors that emit events via commands/aggregates. How can we support this use case?
Ah, so you mean the reactors don't use emit_event
? Not sure of an easy way to handle that off the top of my head.
Yeah, exactly. Sorry to throw a spanner.
Closing this as it's really related to https://github.com/envato/event_sourcery-postgres at this point. Also there still seems to be some unsolved problems and differing opinions over how this should work. Until another time! Thanks for all the reviews.
This is a WIP and may be force pushed still.
Changes
metadata
(jsonb
) column on theevents
table for storingcausation_id
andreactor_name
last_actioned_event_id
column on theprojector_tracker
tableProcess
last_actioned_event_id
column on theprojector_tracker
last_actioned_event_id
and if it is we ignore the eventsetup
if thelast_actioned_event_id
is0
we query theevents
table and attempt to find the most recentcausation_id
stored in the event metadata. If we find one we setlast_actioned_event_id
to that valueThis is probably better explained by the code or by @vonconrad's comment here: https://github.com/envato/event_sourcery/issues/24#issuecomment-297965493 (See 3.2).
TODO
EventStoreWithOptimisticConcurrency#write_events_sql
Fixes https://github.com/envato/event_sourcery/issues/24.