users@glassfish.java.net

Re: Application Scoped Resources: Why not for JMS?

From: <forums_at_java.net>
Date: Fri, 15 Jul 2011 07:34:08 -0500 (CDT)

A quicker way would be to :

use CLI/GUI to create the jms resource and use the configuration in
glassfish-resources.xml.

eg using CLI :

asadmin create-jms-resource --restype javax.jms.QueueConnectionFactory
jms/ejb_ejb30_hello_mdb_QCF
asadmin create-jms-resource --restype javax.jms.Queue --property
imqDestinationName=ejb_ejb30_hello_mdb_InQueue
jms/ejb_ejb30_hello_mdb_InQueue

These will get registered in domain.xml as :

<connector-connection-pool max-pool-size="250" steady-pool-size="1"
name="jms/ejb_ejb30_hello_mdb_QCF" resource-adapter-name="jmsra"
connection-definition-name="javax.jms.QueueConnectionFactory"></connector-connection-pool>

    <connector-resource pool-name="jms/ejb_ejb30_hello_mdb_QCF"
jndi-name="jms/ejb_ejb30_hello_mdb_QCF"></connector-resource>

    <admin-object-resource res-adapter="jmsra" res-type="javax.jms.Queue"
jndi-name="jms/ejb_ejb30_hello_mdb_InQueue">
      <property name="Name"
value="ejb_ejb30_hello_mdb_InQueue"></property>
    </admin-object-resource>

Use the same in glassfish-resources.xml (Note the java:app prefix) :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD GlassFish Application
Server 3.1 Resource Definitions //EN"
"http://glassfish.org/dtds/glassfish-resources_1_5.dtd">
<resources>
<connector-connection-pool max-pool-size="250" steady-pool-size="1"
name="java:app/jms/ejb_ejb30_hello_mdb_QCF" resource-adapter-name="jmsra"
connection-definition-name="javax.jms.QueueConnectionFactory"></connector-connection-pool>
    <connector-resource pool-name="java:app/jms/ejb_ejb30_hello_mdb_QCF"
jndi-name="java:app/jms/ejb_ejb30_hello_mdb_QCF"></connector-resource>
    <admin-object-resource res-adapter="jmsra" res-type="javax.jms.Queue"
jndi-name="java:app/jms/ejb_ejb30_hello_mdb_InQueue">
      <property name="Name"
value="ejb_ejb30_hello_mdb_InQueue"></property>
    </admin-object-resource>
</resources>
                     
 


--
[Message sent by forum member 'jr158900']
View Post: http://forums.java.net/node/821986