Ask questions and see you at July, 3rd 8 pm CET: youtube.com/c/bienadam
Also checkout recent episode:
Please keep the questions as short and as concise as only possible. Feel free to ask several, shorter questions. I will also cover some questions in my "shorts" youtube.com/@bienadam/shorts between the shows.
Upcoming airhacks.tv events are also going to be announced at meetup.com/airhacks
New: the airhacks.tv discord server: discord.gg/airhacks
Hallo Adam,
in your Vimeo-Video-Course "Microservices", you describe the opportunity to introduce ManagedExecutorService in combination with @suspended and AsyncResponse to execute the business code in another thread (execution-thread).
The problem here is, that within this execution-thread from the ExecutorService, all/most RequestScroped beans are not available and throw a ContextNotActiveException (especially all injected objects which are HTTP-Request-aware like JsonWebToken, Principal, HttpSevletRequest and so on)... which is understandable because the injected beans are proxies and they are bound to the Http-thread.
Is there a more elegant way to access these "injected" beans instead of fetching all relevant informations from these beans and pass these concrete values to the execution-thread as method parameters?
I also found/tried this annotation (javax.enterprise.context.control.ActivateRequestContext) at the executed method, which is called from the execution-thread, but this does not change anything.
Many thanks in advance, Ulrich