You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Romain Manni-Bucau <rm...@gmail.com> on 2013/09/18 06:41:25 UTC

Re: scope for jms resource into cdi

Hi

Context and queue can be appscoped but other should be
requestscoped...excepted you sont have any request so it wouldnt work as
expected (will be fixed in next spec version). That said the connection
factory can be injected with @resource, then cdi is quite useless...
Le 18 sept. 2013 01:12, "mauro2java2011" <ma...@gmail.com> a
écrit :

> I would use cdi method producer  for get  JmsFactory and Queque ,
> connection
> and Session.
> I use method @Produces and dispose .
> I have write the application jmd
> S and deployed at tomee remote.
> Now into another tomcat wirh a jsf application i would send a message at
> tomee remote.
>
> I have write a class for produce:
> 1) The contextinitial remote ( the context i have to make
> @ApplicationScoped?????)
>
> Next i get the ConnectionFactoriJms with a method Producer and like
> parameter at method i pass the contecxt)
>
> 2) the returned ConnectionFactory from the @Producer i have to make
> @RequestScoped  ??? )
>
> 3) the queque also to make it RequestScoped?
>
> 4) also for the session for create the message ?
> 5) the initiial context for the remote jndi it is ok if i declsre
> @ApplicationScoped?
>
>
> Or i have open and close it at each request?
>
> Or
>
>
>
>
>
>
> Get the InitialContext with method @Produces
> I  code with a jndi lookup on context for get the jms resources.
> I ask:
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/scope-for-jms-resource-into-cdi-tp4665108.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>