Hello,
I recently came to the conclusion that our application could greatly benefit from using CQRS with Event Sourcing. We currently have multiple Spring Boot applications that work in a “traditional” manner. Our application must support multiple tenants. We chose to separate our data on a schema level. Hibernate currently takes care of selecting the data source. This makes it very convenient because we don’t need to worry about tenants when we implement new features.
I hoped that Axon would support multiple tenants but I cannot find a real guide for it. We want to use the Axon Enterprise Server because of its advertised multi-tenant support using contexts. How do we need to configure Axon to become tenant/multi-context aware?
I’ve found the REST API of the Axon Server which would allow the dynamic creation of new contexts specific to each tenant. However, Axon Framework seems to only support a single context in its configuration. I am also wondering how event handlers and so on subscribe to multiple contexts at the same time. It seems to be impossible to share computing resources for multiple tenants using Axon. The only solution I can come up with is to deploy separate applications for each tenant that are configured with the corresponding context. This, however, defeats the whole purpose of developing a multi-tenant application.
I hope I am missing some important piece.
Thank you in advance
Daniel