users@glassfish.java.net

Re: Glassfish 3.1 - glassfish-resources.xml && JMS Queues?

From: Jagadish Prasath Ramu <jagadish.ramu_at_oracle.com>
Date: Mon, 02 May 2011 16:26:52 +0530

jms resources are internally realized as connector-resource,
connector-connection-pool and admin-object-resource based on the type
specified.

eg:
When you create a jms-resource with "javax.jms.ConnectionFactory" (or
any other connection factory like
QueueConnectionFactory/TopicConnectionFactory) as type , it would be
realized as a connector-connection-pool and connector-resource of same
name.

Similarly, when you create a jms-resource with
javax.jms.Queue/javax.jms.Topic as type, it is realized as admin-object
resource.

You could copy the configuration of these from domain.xml and use it for
your resources xml file.

Sample resources xml configuration :
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<?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 description="ccp"
name="jms/ConnectionFactory" resource-adapter-name="jmsra"
connection-definition-name="javax.jms.TopicConnectionFactory"
transaction-support=""></connector-connection-pool>
    <connector-resource pool-name="jms/ConnectionFactory"
jndi-name="jms/ConnectionFactory"></connector-resource>
    <admin-object-resource res-adapter="jmsra"
res-type="javax.jms.Queue" description="" jndi-name="test">
      <property description="my-aor" name="Name"
value="test"></property>
    </admin-object-resource>
  </resources>
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------

-- 
Thanks,
-Jagadish
Sun, an Oracle Company.
On Mon, 2011-05-02 at 16:36 +0930, Andrew Hughes wrote:
> Hi,
> 
> 
> I can see several references that suggest a JMS Queue can be
> configured in *.ear:./WEB-INF/glassfish-resources.xml ....
> 
> 
> For
> example: http://download.oracle.com/javaee/6/tutorial/doc/bnceh.html says....
> 
> 
>         With GlassFish Server, you can use the asadmin
>         create-jms-resource command or the Administration Console to
>         create JMS administered objects in the form of connector
>         resources. You can also specify the resources in a file
>         named glassfish-resources.xml that you can bundle with an
>         application.
> 
> 
> But I can't see any documentation or examples on how this is done. I
> feel like I've exhausted all avenues I know :'( so help would be very
> much appreciated.
> 
> 
> 
> 
> Cheers!!!
> --AH
> 
>