Why is JNDI important anyway?

Jerry Smith

JMS clients must set up the proper network-capable objects, for example, connection factories, in order to obtain access to other server-resident objects, for example, connections and topics. The latter objects are, of course, fundamental to JMS-based interclient communication.

With some JMS implementations, a client obtains a connection factory directly using local instantiation (new AVendorConnectionFactory()). This approach requires access to server-oriented classes. In some environments, it's preferable not to distribute the vendor's classes (typically, housed in JAR files) to network hosts executing JMS clients.

JNDI facilitates server-side administration of JMS-related functionality and service-oriented access to JMS functionality for clients. In general, JNDI offers another level of (network) indirection between each client and various servers, which can be important for reducing version-related incompatibilities for frequently upgraded software.