7

How can I access, throughout a Spring application, the current thread scope...

In other words, how can I identify if the current thread scope is a request or a system local thread ?

ggdio
  • 170
  • 1
  • 7

1 Answers1

12

Try with

if (RequestContextHolder.getRequestAttributes() != null) 
   // request thread
Jose Luis Martin
  • 10,459
  • 1
  • 37
  • 38