users@glassfish.java.net

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

From: Nigel Deakin <nigel.deakin_at_oracle.com>
Date: Tue, 03 May 2011 14:39:37 +0100

On 02/05/2011 08:06, 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.
>

This page in the Oracle GlassFish Server 3.1 Application Deployment Guide lists the element hierarchy
http://download.oracle.com/docs/cd/E18930_01/html/821-2417/giyhh.html

However this is a bit cryptic, so here's a simple example which defines a administered queue resource which has a JNDI
name of "jms/inboundQueue" and a physical destination name of "inboundQueue".

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE resources PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Resource Definitions //EN"
"http://www.sun.com/software/appserver/dtds/sun-resources_1_3.dtd">
<resources>
<admin-object-resource enabled="true" jndi-name="jms/inboundQueue" object-type="user" res-adapter="jmsra"
res-type="javax.jms.Queue">
<description/>
<property name="Name" value="inboundQueue"/>
</admin-object-resource>
</resources>

Nigel