Hello AxonIQ
We are working in a multi tenant application and we faced this situation:
There is an aggregate that receives a command and publish an event. The tenantId metadata is populated in event correctly and published to the right context as expected.
Then, we are listening that event in a saga that starts or cancel a scheduler.
I noticed that when we are cancelling a scheduler we got this log message:
No current tenant found. Canceling schedule token SimpleScheduleToken{tokenId=ā33febd4b-24b0-4edd-a08a-7f33fd014f8eā} by searching in all tenants.
We debug and we noticed that axon is not able to get the tenant from the TenantWrappedTransactionManager (the getCurrentTenant returns null)
However, we can see that we are inside of a transaction:
TransactionSynchronizationManager.isActualTransactionActive() == true
And from the documentation, we were expecting that the TenantWrappedTransactionManager was able to resolve the tenant
While in transaction you may find out which tenant owns transaction by calling:
TenantWrappedTransactionManager.getCurrentTenant()
Are we missing some configuration here?
Thanks in advance
Kind regards
Filipe Marques