[cdi-dev] JMS 2.1: Proposal to allow any CDI managed bean in a Java EE application to listen for JMS messages

arjan tijms arjan.tijms at gmail.com
Wed Aug 26 07:33:02 EDT 2015

On Wed, Aug 26, 2015 at 1:10 PM, John D. Ament <john.d.ament at gmail.com> wrote:
> The JMS provider would be responsible for retrieving a contextual reference
> to the bean and then invoking the method.

But in that case the contextual reference to the bean would be within
the single request scope that the resource adapter adapter sees.
Likewise, IFF the bridging would be done via an MDB, and the MDB would
retrieve a contextual reference of an @RequestScoped bean, then it
would be the single instance corresponding to the same request the MDB

What I think is wanted here is that an arbitrary *other* request
that's active, say an HTTP request to a Servlet, has an active
@RequestScoped bean and the resource adapter or MDB invokes a method
on the bean in that other request scope.

Correct me if I'm wrong, but this is not entirely how CDI normally
works, where contextual references always resolve to beans that are in
the scope of the caller.

More information about the cdi-dev mailing list