Red Hat Training

A Red Hat training course is available for Red Hat JBoss Enterprise Application Platform

Chapter 7. Remote JNDI Lookup

7.1. Registering Objects to JNDI

The Java Naming and Directory Interface (JNDI) is a Java API for a directory service that allows Java software clients to discover and look up objects using a name. To look up an object, you must first register that object to JNDI using the java:jboss/exported context.
The following is an example of how to register a JMS queue to JNDI in the messaging subsystem so that it can be looked up by remote JNDI clients.
java:jboss/exported/jms/queue/myTestQueue
Remote JNDI clients can then look up the object using the above name; however, it is not necessary to specify the java:jboss/exported/ prefix when looking up a remote client. The remote JNDI clients can look up the remote object up using the following name.
jms/queue/myTestQueue

Example 7.1. Example of Standalone Server JMS Queue Configuration

<subsystem xmlns="urn:jboss:domain:messaging:1.4">
   <hornetq-server>
      ...
      <jms-destinations>
         <jms-queue name="myTestQueue">
            <entry name="java:jboss/exported/jms/queue/myTestQueue"/>
         </jms-queue>
      </jms-destinations>
   </hornetq-server>
</subsystem>