Let me go through your questions one by one.
- I suppose that i should create a “EmbeddedEventStore” for each “MongoEventStorageEngine” right? i have seen the AxonAutoConfiguration class and iñm not sure what is a “MessageMonitor”?
Your assumption is correct. The easiest thing to have multiple ‘streamable event sources’ is to introduce several
EmbeddedEventStores, all with their own
MessageMonitor can be wired into your
EventBus, as well as your
EventProcessors to get message ingestion metrics based on Dropwizard/Metrics.
- Reading the documentation seems like “Tracking Processors” are created automatically using the package names (https://docs.axonframework.org/part-iii-infrastructure-components/event-processing#assigning-handlers-to-processors), so how can we organize/setup the different Tracking Proccessor to get events from different event stores/EmbeddedEventStore? is using the “source” property? how can we choose this “source” for each EmbeddedEventStore?
Yes, Axon will automatically wire everything for you in a Spring environment, but you can very easily override that. In Axon 3.3 you can use the
EventProcessingConfiguration (versions below 3.3 have the
EventHandlingConfiguration) to instantiate your TrackingEventProcessors. You do this by using the
registerTrackingEventProcessor() function. The
name parameter is the name of the processing group you’ve given to your Tracking Event Processor. The important part in configuring your Tracking Event Processor this way, is by providing the right
StreamableMessageSource (which I referred to in answer 1). The
StreamableMessageSource is an interface which the
EmbeddedEventStore implements. As you’ve specified several
EmbeddedEventStores, you can select the rigth one to be used by the right
- Talking about a Saga, how are the event processor assigned to a Saga?
Saga’s receive their events by means of Event Processors as well, which is configurable by using the
SagaConfiguration. This class allows you to configure your saga to use either a Subscribing or a Tracking Event Processor (so, identical to regular event handling components).
can a Saga listen for event from multiple EventStores??
No, this currently is not an option, although we do see this as a reoccurring question. Hence we do have it on the roadmap to be introduced in our products (Framework, AxonHub and AxonDB), eventually. As such I cannot give you a time frame when this will be introduced.
Hope this helps you out for now Jorge.