You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is an issue with 80 comments on this, but it's closed for discussion, with no further explanation: #60
There is a MR, but again - without any answer: #549
We need either request scope to work in CQRS module or any viable alternative.
Describe the solution you'd like
Either make request scoped providers work with CQRS module or providing an alternative, how to do multi-tenant applications. Creating separate query bus for every request seems too much of an overhead, but I think it's acceptable, when combined with durable providers and limited number of tenants.
What is the motivation / use case for changing the behavior?
We are implementing multitenancy in quite big application, with many modules that need to be configured differently, for different tenants. Unfortunately, async_hooks will not be an easy solution, since many modules are configured once, upon their creation. Request scope + durable providers seems to be simplest solution, but it doesn't work with CQRS module.
The text was updated successfully, but these errors were encountered:
If you need to use request scope with CQRS, you'd either need to play with ContextIdFactory or use an alternative like AsyncLocalStorage to propagate request context.
Is there an existing issue that is already proposing this?
Is your feature request related to a problem? Please describe it
Normally we can do multitenancy using durable providers:
https://docs.nestjs.com/fundamentals/injection-scopes#durable-providers
However this doesn't work when using CQRS module.
There is an issue with 80 comments on this, but it's closed for discussion, with no further explanation:
#60
There is a MR, but again - without any answer:
#549
We need either request scope to work in CQRS module or any viable alternative.
Describe the solution you'd like
Either make request scoped providers work with CQRS module or providing an alternative, how to do multi-tenant applications. Creating separate query bus for every request seems too much of an overhead, but I think it's acceptable, when combined with durable providers and limited number of tenants.
Teachability, documentation, adoption, migration strategy
No response
What is the motivation / use case for changing the behavior?
We are implementing multitenancy in quite big application, with many modules that need to be configured differently, for different tenants. Unfortunately, async_hooks will not be an easy solution, since many modules are configured once, upon their creation. Request scope + durable providers seems to be simplest solution, but it doesn't work with CQRS module.
The text was updated successfully, but these errors were encountered: