core-java icon indicating copy to clipboard operation
core-java copied to clipboard

Consider adding some API for tenant-aware services

Open dmytro-kashcheiev opened this issue 3 years ago • 0 comments

In a multi-tenant environment most likely some of the non Spine services will be multi-tenant as well. Currently, there is no way to easily implement a custom tenant-aware service. As result all calls to such services start to look multitenantService.doSomething(TenantId id .... ). In addition, it's impossible to access tenantId before the signal handler method as result all these tenant-based calls moved inside signal handlers and get them dirty and more complex.

The simplest and strict forward solution from the developer's point of view can be achieved by expanding the API of Repository.configure(Entity) to configure(TenantId, Entity). Such API will provide the possibility to correctly configure tenant-aware service before injecting it into the entity. Consider adding some API for custom multi-tenant services.

dmytro-kashcheiev avatar Nov 08 '21 10:11 dmytro-kashcheiev