Is there any way I can create, lets say a Context, and depending on the function stack know in what context I am in and retrieve values out of it?
e.g.:
Request comes into Controller (Contains requestId in header). Controller calls function from Service1. Service1 calls function from Service2.
Controller -1-> Service1 -2-> Service2
^ | ^ |
| | | |
+---return---+ +---return---+
If I need the requestId in Service2, i have to pass it all the way down manually. But it would be way more convenient to pass it via a "function stack context" (or whatever).
Thank you in advance