title: Spring boot request interceptor and thread local
body: <p>I am working on a spring boot application in which I have to add an attribute to the root level of every JSON request. This will cost me to change every service manually to adjust the new variable. I am thinking a way around that if I intercept the request and fetch that attribute's value and set it in a ThreadLocal variable so that I can get the variable later within the execution scope of that request later. Is it possible with spring as I am confused with this image
  <a href="https://i.stack.imgur.com/Pi25s.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Pi25s.gif" alt="Request Scope"></a>
  How the Spring will behave to my hack in this scenario as the web application is too big to change it manually.</p>
  
  <p>Thanks &amp; Regards,</p>