multi-tenant-app-demo icon indicating copy to clipboard operation
multi-tenant-app-demo copied to clipboard

How do we pass tenantId info when we are switching thread

Open SubhamSinghal opened this issue 3 years ago • 1 comments

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?

SubhamSinghal avatar Apr 27 '21 06:04 SubhamSinghal

You can use decorator pattern to pass your thread context to new threads. https://stackoverflow.com/questions/45890181/logging-mdc-with-async-and-taskdecorator

paksboda avatar May 08 '21 07:05 paksboda