Hi,
I'm looking into payara micro performance and saw examples of how to use asynchronous processing for longer running API calls via Jersey...
This is great as implementing this for a longer lived call simulated using a Thread.sleep means that a single instance is processing thousands more requests a second. However the question is how to make use of this to call CDI beans. If I inject a request scoped bean into my jersey class then it works fine when doing synchronous processing, however as soon as I use the @ManagedAsync annotation then I get the following error when calling my request scoped bean:
org.jboss.weld.contexts.ContextNotActiveException: WELD-001303: No active contexts for scope type javax.enterprise.context.RequestScoped
I'm assuming that's because the thread call is now outside of the context created by the initial request into jersey, however this effectively renders asynchronous processing useless as I'm not able to use all the container features available to my CDI means. Is there something I should be doing to support this or is it simply not possible to use both together?
Many thanks,
Darren