Skip to content

Instantly share code, notes, and snippets.

Created May 31, 2023 07:42
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Copy link

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

Copy link

I want to deploy my angular application automaticly to aws lambda. Now i search a good instruction to do this. Does everyone known a good one?
someone is better
from: /

Copy link

AdamBien commented Jul 3, 2023

The time machine. Questions from the 12th episode:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment