blob: b7aefaf8e2d758022b73e6bb09e211e87df05601 [file] [log] [blame]
<?xml version="1.0"?>
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
<chapter xmlns="" version="5.0" xml:id="JMS-Client-0-8-JNDI-Properties-Format">
<title>JNDI Properties Format</title>
<para>The Client comes with own JNDI context factory
<literal>org.apache.qpid.jndi.PropertiesFileInitialContextFactory</literal> which utilises a
Java properties file for declaring the JMS administered objects: connection factories, queues,
topics and destinations. It uses the following syntax:</para>
connectionfactory.&lt;jndi name&gt;=&lt;connection url&gt;
queue.&lt;jndi name&gt;=&lt;queue name&gt;
topic.&lt;jndi name&gt;=&lt;topic name&gt;
destination.&lt;jndi name&gt;=&lt;binding url&gt;
<para>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.</para>
<para>The application looks up the objects via an InitialContext. This lookup and an example JNDI
properties file is provided in <xref linkend="JMS-Client-0-8-Examples"/></para>
<para>We now consider each JMS administered object type in turn.</para>
<section xml:id="JMS-Client-0-8-JNDI-Properties-Format-ConnectionFactory">
<para><literal>connectionfactory.</literal><emphasis>name</emphasis> declares a <link xmlns:xlink="" xlink:href="${oracleJeeDocUrl}javax/jms/ConnectionFactory.html">ConnectionFactory</link> with the
given JNDI name. The value must be a legal Connection URL.</para>
<para>See <xref linkend="JMS-Client-0-8-Connection-URL"/> for format of the URL and its
permitted options.</para>
<section xml:id="JMS-Client-0-8-JNDI-Properties-Format-Queue">
<para><literal>queue.</literal><emphasis>name</emphasis> declares a <link xmlns:xlink="" xlink:href="${oracleJeeDocUrl}javax/jms/Queue.html">Queue</link> with the given JNDI name. The
value is simple queue name. This is the name of the queue as known by the Broker.</para>
<para>The <literal>queue.</literal> form is a short hand for declaring a destination:</para>
<screen>;queue name&gt;?routingkey=’&lt;queue name&gt;’&amp;durable=’true’</screen>
<section xml:id="JMS-Client-0-8-JNDI-Properties-Format-Topic">
<para><literal>topic.</literal><emphasis>name</emphasis> declares a <link xmlns:xlink="" xlink:href="${oracleJeeDocUrl}javax/jms/Topic.html">Topic</link> with the given JNDI name. The
value is topic name. This topic name is used on the Broker as a binding key between the
<literal>amq.topic</literal> exchange and the queue corresponding to the topic
<para>The <literal>topic.</literal> form is a short hand for declaring a destination:</para>
<screen>;topic name&gt;/?routingkey=&lt;topic name&gt;</screen>
<section xml:id="JMS-Client-0-8-JNDI-Properties-Format-Destination">
<para><literal>destination.</literal><emphasis>name</emphasis> declares either a <link xmlns:xlink="" xlink:href="${oracleJeeDocUrl}javax/jms/Queue.html">Queue</link> or <link xmlns:xlink="" xlink:href="${oracleJeeDocUrl}javax/jms/Topic.html">Topic</link> (depending on the class) with the
given JNDI name. The value must be a Binding URL.</para>
<para>See <xref linkend="JMS-Client-0-8-Binding-URL"/> for format of the URL and its permitted