Hi again!
Can we be sure that a event only is processed one time (No more than one projector get the event)? How is this implemented?
Depends on how you set up the TokenStore. If multiple event processor instances share a TokenStore (Jpa, Jdbc or Mongo tokenstore), they will use this to coordinate with one another by claiming events, so then yes you would have that guarantee. If you use separate TokenStores for the processors (like an InMemoryTokenStore, which is the default), all processors would get all events (which is sometimes useful as well).
Is the order of the event stream ensured? i mean, the event number 5 never be processed before the event 4?
If you have a single instance running a single thread, yes. As soon as you run across multiple instances or multiple threads in the same instance, it’s impossible to guarantee full ordering of events. Therefore, Axon allows you to specify a SequencingPolicy to determine which events have to be processed in a guaranteed order, which means they have to be processed in the same thread. Default is to process events relating to the same aggregate on the same thread.
How the “Tracking Event Processor” work for mongo EventStore? is a pulling mechanism? i mean, is a process that is asking to the data base in intervals or how it works?
It’s implemented in EmbeddedEventStore, in exactly the same way for Mongo or RDBMS storage engines. Yes, essentially it’s doing polling, which works but has some obvious downsides. This is one of the things that are solved much more elegantly in AxonDB. AxonDB can actively push events to tracking event processors after the event has been committed, so no polling is required, and events are delivered faster.
Kind regards,