Command resulting in several events


is there a central place in the Axon framework where I can get all events published as result of a command in ordered sequence?

I need to grab the last event in the stream to add some metadata.


Hi Geir,

there’s a few places where you can hook into the Events and Streams.
In the UnitOfWork you can define a UnitOfWorkListener, which receives notifications when it is committed. You’ll get access to all aggregates and events for publication. You can get the EventMetaData from the event and cast it to MutableEventMetaData.

I’m eager to learn about your use-case, since Axon 2 uses different mechanisms as Events (the EventMessages to be exact) are immutable. I want to make sure your usecase is supported in Axon 2 as well.




I just made a thread waiter so the gui can wait for the effects of a command in an eventually consistent system. It puts a token into a command and waits for an event with the same token. Works when only one event gets dispatched from command handling. What I need is a way of tagging an event with ‘there are more events behind me, hold on’ kind of tag.