Using the JMS Binding Component

Using the lookup Approach

To access a connection factory that is bound in the JNDI space of the GlassFish application server itself, use the lookup approach.

This scenario can occur when a managed connection factory has been created. Managed connection factories provide additional services on top of a connection factory. The additional services include connection pooling. The managed connection factory creates a connection factory wrapper.

Set the connection URL to lookup://JNDI-name, where JNDI-name is the JNDI name to which the connection factory is bound. For example:


lookup://jms/tx/default

When you use a wizard to create a JMS-based concrete WSDL document, you set the connection URL in the Request Connection Configuration step of the wizard. For more information, see Creating JMS-Based Concrete WSDL Documents.

When you finish the wizard, the appropriate WSDL code is generated. The connection URL appears in the address element. For example:


<port name="newWSDL_InPort" binding="tns:JMSInBinding">
  <jms:address connectionURL="lookup://jms/tx/default">
    <jms:jmsjcaOptions><![CDATA[]]></jms:jmsjcaOptions>
  </jms:address>
</port>

At runtime, the JMS Binding Component uses the JNDI name to obtain the connection factory.