# JNDI Properties Format

The Qpid JMS Client comes with own JNDI context factory `org.apache.qpid.jndi.PropertiesFileInitialContextFactory` which utilises a Java properties file for declaring the JMS administered objects: connection factories, queues, topics and destinations. It uses the following syntax:

    connectionfactory.<jndi name>=<connection url>
    queue.<jndi name>=<queue name>
    topic.<jndi name>=<topic name>
    destination.<jndi name>=<binding url>

An arbitrary number of connection factories, queues, topics, queues or destinations or can be declared in the JNDI properties file. Each JNDI name must be unique.

The application looks up the objects via an InitialContext. This lookup and an example JNDI properties file is provided in

We now consider each JMS administered object type in turn.

## ConnectionFactory

`connectionfactory.` name declares a ConnectionFactory with the given JNDI name. The value must be a legal Connection URL.

See for format of the URL and its permitted options.

## Queue

`queue.` name declares a Queue with the given JNDI name. The value is simple queue name. This is the name of the queue as known by the Broker.

The `queue.` form is a short hand for declaring a destination:

    destination.name=direct://amq.direct//<queue name>?routingkey=’<queue name>’&durable=’true’

## Topic

`topic.` name declares a Topic with the given JNDI name. The value is topic name. This topic name is used on the Broker as a binding key between the `amq.topic` exchange and the queue corresponding to the topic subscriber.

The `topic.` form is a short hand for declaring a destination:

    destination.name=topic://amq.topic/<topic name>/?routingkey=<topic name>

## Destination

`destination.` name declares either a Queue or Topic (depending on the class) with the given JNDI name. The value must be a Binding URL.

See for format of the URL and its permitted options.