eventhorizon icon indicating copy to clipboard operation
eventhorizon copied to clipboard

[commandbus] Local command bus should only handle one command per aggregate ID at a time

Open maxekman opened this issue 8 years ago • 6 comments

maxekman avatar Nov 10 '16 08:11 maxekman

Is this fixed? Will it cause race condition?

dantetwc avatar Mar 21 '17 04:03 dantetwc

This is not fixed, it may cause race conditions depending on your setup of event handlers (projections, sagas etc).

maxekman avatar Mar 21 '17 07:03 maxekman

if using SimpleEventHandlingStrategy then it shouldn't be any race condition? Anyway, thanks for your amazing work @maxekman

dantetwc avatar Mar 21 '17 07:03 dantetwc

Thanks!

Yes, that will at least make it more predictable. It all depends on if you dispatch commands from different goroutines or not (dispatching on HTTP requests will be concurrent for example).

maxekman avatar Mar 21 '17 07:03 maxekman

Is there already a solution for this issue here? And if not, what would be the steps to implement one?

janiskemper avatar Sep 27 '21 12:09 janiskemper

Not yet in the library. You can either rely on the event store dictating which command gets saved first (the other fails) or you could write your own wrapper which for example keeps a map of IDs that are currently being handled.

maxekman avatar Sep 27 '21 12:09 maxekman