portably you can't but our mdbs support ${system.prop.key.name}
syntax...an alternative would be to define the mdb using ejb-jar.xml
and not annotations.
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau2013/12/3 ZhongGuan <[email protected]>: > thanks,Romain. > Here is my complete setting > in tomee.xml > <Resource id="jms/FooQueue" type="javax.jms.Queue"> > destination FooQueue > </Resource> > > I have a servlet with > @Resource(name="FooQueueRef") > private Queue fooQueue; > > in web.xml > <resource-env-ref> > <resource-env-ref-name>FooQueueRef</resource-env-ref-name> > <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type> > <mapped-name>jms/FooQueue</mapped-name> > </resource-env-ref> > > in MDB > @ActivationConfigProperty(propertyName = "destinationName", propertyValue = > "FooQueue") > the MDB works fine. and > in Jconsle, > I can find the "FooQueue" in ActiveMq. > > My understanding is , > I define a queue named FooQueue in Tomee, and its JNDI name is jms/FooQueue > I mapped this JNDI name to a local JNDI name to "FooQueueRef" > In servlet, I can inject this Queue by using name="FooQueueRef" and send > message to it. > At last, the MDB can consume this message by setting the destinationName of > "FooQueue". > > And if I change the destination in tomee.xml from FooQueue to FooQueue111. > the other settings are same. > In Jconsole, I can fine two queue, one is "FooQueue111", another is > "FooQueue". > > I think the FooQueue111 is from the setting in tomee.xml > and the FooQueue is from the propertyValue = "FooQueue". > because there has no FooQueue, so Tomee or other something creates this > one. > > So I want to know > If I change the destination name in tomee.xml, And If I do not want to > change the mdb source. > How Can I do? > Maybe, do not use Annotation is a way, and Is there any other way? > > Thanks. > > > > > > > > > > > > -- > View this message in context: > http://openejb.979440.n4.nabble.com/MDB-mappedname-or-destination-name-tp4666505p4666517.html > Sent from the OpenEJB User mailing list archive at Nabble.com.
