multi-tenant-app-demo
multi-tenant-app-demo copied to clipboard
How do we pass tenantId info when we are switching thread
TenantId is stored in a thread local variable. Now if we switch thread either by using ExecutorService or Vertx event then how can we pass tenant info to other thread?
You can use decorator pattern to pass your thread context to new threads. https://stackoverflow.com/questions/45890181/logging-mdc-with-async-and-taskdecorator