summaryrefslogtreecommitdiff
path: root/qpid/doc/book/src/jms-client-0-8/JMS-Client-JNDI-Properties-Format.xml
blob: fb7d96fd6829e252ecca29156ed49d7d6f2f9402 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
                    "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
[
<!ENTITY %  entities SYSTEM  "commonEntities.xml">
%entities;
]>
<!--

 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

   http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.

-->

<chapter id="JMS-Client-0-8-JNDI-Properties-Format">
  <title>JNDI Properties Format</title>

  <para>The Qpid JMS 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>
  <para>
    <screen><![CDATA[
connectionfactory.<jndi name>=<connection url>
queue.<jndi name>=<queue name>
topic.<jndi name>=<topic name>
destination.<jndi name>=<binding url>
]]></screen></para>
  <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 id="JMS-Client-0-8-JNDI-Properties-Format-ConnectionFactory">
    <title>ConnectionFactory</title>
    <para><literal>connectionfactory.</literal><emphasis>name</emphasis> declares a <ulink
        url="&oracleJeeDocUrl;javax/jms/ConnectionFactory.html">ConnectionFactory</ulink> 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>
  <section id="JMS-Client-0-8-JNDI-Properties-Format-Queue">
    <title>Queue</title>
    <para><literal>queue.</literal><emphasis>name</emphasis> declares a <ulink
        url="&oracleJeeDocUrl;javax/jms/Queue.html">Queue</ulink> 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><![CDATA[destination.name=direct://amq.direct//<queue name>?routingkey=’<queue name>’&durable=’true’]]></screen>
  </section>
  <section id="JMS-Client-0-8-JNDI-Properties-Format-Topic">
    <title>Topic</title>
    <para><literal>topic.</literal><emphasis>name</emphasis> declares a <ulink
        url="&oracleJeeDocUrl;javax/jms/Topic.html">Topic</ulink> 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
      subscriber.</para>
    <para>The <literal>topic.</literal> form is a short hand for declaring a destination:</para>
    <screen><![CDATA[destination.name=topic://amq.topic/<topic name>/?routingkey=<topic name>]]></screen>
  </section>
  <section id="JMS-Client-0-8-JNDI-Properties-Format-Destination">
    <title>Destination</title>
    <para><literal>destination.</literal><emphasis>name</emphasis> declares either a <ulink
        url="&oracleJeeDocUrl;javax/jms/Queue.html">Queue</ulink> or <ulink
        url="&oracleJeeDocUrl;javax/jms/Topic.html">Topic</ulink> (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
      options.</para>
  </section>


</chapter>