You can use a resource attribute called name to match the resource id of tomee.xml Le 4 juin 2013 16:11, "Leonardo K. Shikida" <[email protected]> a écrit :
> Hi > > sorry for my ignorance :-) > > I am trying to put together > > > http://tomee.apache.org/examples-trunk/injection-of-connectionfactory/README.html > > with > > http://tomee.apache.org/jms-resources-and-mdb-container.html > > so, if I just add > > <Resource id="MyJmsResourceAdapter" type="ActiveMQResourceAdapter"> > BrokerXmlConfig = broker:(tcp://localhost:61616) > ServerUrl = tcp://localhost:61616 > DataSource = MyJMSDataSource > </Resource> > > <Resource id="MyJMSDataSource" type="javax.sql.DataSource"> > JdbcDriver = com.mysql.jdbc.Driver > JdbcUrl = jdbc:mysql://localhost:3306/jms > UserName = xxx > Password = xxx > </Resource> > > to my tomee.xml file, it's supposed to activeMQ automatically create a > table into database "jms" and persist all the queue messages there, if I > use > > producer.setDeliveryMode(DeliveryMode.PERSISTENT); > > ? > > will > > @Resource private ConnectionFactory connectionFactory > > automatically be binded to a impliict > > <Resource id="MyJmsConnectionFactory" > type="javax.jms.ConnectionFactory"> > ResourceAdapter = MyJmsResourceAdapter > </Resource> > > ? > > and that's it? or am I missing something? > > > TIA > > Leo >
