You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by jo...@apache.org on 2011/04/28 18:49:56 UTC
svn commit: r1097544 [18/20] - in /qpid/site/docs/books/0.10: ./
AMQP-Messaging-Broker-CPP-Book/ AMQP-Messaging-Broker-CPP-Book/html-single/
AMQP-Messaging-Broker-CPP-Book/html-single/images/
AMQP-Messaging-Broker-CPP-Book/html-single/images/jmx_consol...
Added: qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s07.html
URL: http://svn.apache.org/viewvc/qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s07.html?rev=1097544&view=auto
==============================================================================
--- qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s07.html (added)
+++ qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s07.html Thu Apr 28 16:49:49 2011
@@ -0,0 +1,21 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>2.7. Acknowledging Received Messages</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="Programming in Apache Qpid"><link rel="up" href="ch02.html" title="Chapter 2. Using the Qpid Messaging API"><link rel="prev" href="ch02s06.html" title="2.6. Receiver Capacity (Prefetch)"><link rel="next" href="ch02s08.html" title="2.8. Receiving Messages from Multiple Sources"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">2.7. Acknowledging Received Messages</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s06.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Using the Qpid Messaging API</th><td width="20%" align="right"> <a accesskey="n" href="ch02s
08.html">Next</a></td></tr></table><hr></div><div class="section" title="2.7. Acknowledging Received Messages"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="acknowledgements"></a>2.7. Acknowledging Received Messages</h2></div></div></div><p>Applications that receive messages should acknowledge their
+ receipt by calling the session's acknowledge method. As in the
+ case of sending messages, acknowledged transfer of messages to
+ receivers provides at-least-once reliability, which means that the
+ loss of the connection or a client crash does not result in lost
+ messages; durable messages are not lost even if the broker is
+ restarted.
+
+ Some cases may not require this however and the reliability can be
+ controlled through a link property in the address options (see
+ <a class="xref" href="ch02s04.html#table-link-properties" title="Table 2.3. Link Properties">Table 2.3, “Link Properties”</a>).</p><p>The acknowledge call acknowledges all messages received on
+ the session (i.e. all message that have been returned from a fetch
+ call on a receiver created on that session).</p><p>The acknowledge call also support an optional parameter
+ controlling whether the call is synchronous or not. A synchronous
+ acknowledge will block until the server has confirmed that it has
+ received the acknowledgement. In the asynchronous case, when the
+ call returns there is not yet any guarantee that the server has
+ received and processed the acknowledgement. The session may be
+ queried for the number of unsettled acknowledgements; when that
+ count is zero all acknowledgements made for received messages have
+ been successful.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s06.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s08.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">2.6. Receiver Capacity (Prefetch) </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 2.8. Receiving Messages from Multiple Sources</td></tr></table></div></body></html>
Added: qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s08.html
URL: http://svn.apache.org/viewvc/qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s08.html?rev=1097544&view=auto
==============================================================================
--- qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s08.html (added)
+++ qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s08.html Thu Apr 28 16:49:49 2011
@@ -0,0 +1,37 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>2.8. Receiving Messages from Multiple Sources</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="Programming in Apache Qpid"><link rel="up" href="ch02.html" title="Chapter 2. Using the Qpid Messaging API"><link rel="prev" href="ch02s07.html" title="2.7. Acknowledging Received Messages"><link rel="next" href="ch02s09.html" title="2.9. Transactions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">2.8. Receiving Messages from Multiple Sources</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s07.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Using the Qpid Messaging API</th><td width="20%" align="right"> <a accesskey="n" href="ch02s09.html
">Next</a></td></tr></table><hr></div><div class="section" title="2.8. Receiving Messages from Multiple Sources"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2696591"></a>2.8. Receiving Messages from Multiple Sources</h2></div></div></div><p>A receiver can only read from one source, but many
+ programs need to be able to read messages from many sources. In
+ the Qpid Messaging API, a program can ask a session for
+ the <span class="quote">“<span class="quote">next receiver</span>”</span>; that is, the receiver that is
+ responsible for the next available message. The following
+ examples show how this is done in C++, Python, and .NET C#.
+ </p><p>Note that to use this pattern you must enable prefetching
+ for each receiver of interest so that the broker will send
+ messages before a fetch call is made. See
+ <a class="xref" href="ch02s06.html" title="2.6. Receiver Capacity (Prefetch)">Section 2.6, “Receiver Capacity (Prefetch)”</a> for more on this.</p><div class="example"><a name="id2696623"></a><p class="title"><b>Example 2.12. Receiving Messages from Multiple Sources</b></p><div class="example-contents"><p>C++:</p><pre class="programlisting">
+Receiver receiver1 = session.createReceiver(address1);
+receiver1.setCapacity(10);
+Receiver receiver2 = session.createReceiver(address2);
+receiver2.setCapacity(10);
+
+Message message = session.nextReceiver().fetch();
+std::cout << message.getContent() << std::endl;
+session.acknowledge(); // acknowledge message receipt
+ </pre><p>Python:</p><pre class="programlisting">
+receiver1 = session.receiver(address1)
+receiver1.capacity = 10
+receiver2 = session.receiver(address)
+receiver2.capacity = 10
+message = session.next_receiver().fetch()
+print message.content
+session.acknowledge()
+ </pre><p>.NET C#:</p><pre class="programlisting">
+Receiver receiver1 = session.CreateReceiver(address1);
+receiver1.Capacity = 10;
+Receiver receiver2 = session.CreateReceiver(address2);
+receiver2.Capacity = 10;
+
+Message message = new Message();
+message = session.NextReceiver().Fetch();
+Console.WriteLine("{0}", message.GetContent());
+session.Acknowledge();
+ </pre></div></div><br class="example-break"></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s07.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s09.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">2.7. Acknowledging Received Messages </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 2.9. Transactions</td></tr></table></div></body></html>
Added: qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s09.html
URL: http://svn.apache.org/viewvc/qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s09.html?rev=1097544&view=auto
==============================================================================
--- qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s09.html (added)
+++ qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s09.html Thu Apr 28 16:49:49 2011
@@ -0,0 +1,33 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>2.9. Transactions</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="Programming in Apache Qpid"><link rel="up" href="ch02.html" title="Chapter 2. Using the Qpid Messaging API"><link rel="prev" href="ch02s08.html" title="2.8. Receiving Messages from Multiple Sources"><link rel="next" href="ch02s10.html" title="2.10. Connection Options"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">2.9. Transactions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s08.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Using the Qpid Messaging API</th><td width="20%" align="right"> <a accesskey="n" href="ch02s10.html">Next</a></td></tr></table><hr></div><d
iv class="section" title="2.9. Transactions"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2696676"></a>2.9. Transactions</h2></div></div></div><p>Sometimes it is useful to be able to group messages
+ transfers - sent and/or received - on a session into atomic
+ grouping. This can be done be creating the session as
+ transactional. On a transactional session sent messages only
+ become available at the target address on commit. Likewise any
+ received and acknowledged messages are only discarded at their
+ source on commit
+
+ <sup>[<a name="id2696709" href="#ftn.id2696709" class="footnote">8</a>]</sup>
+
+ .</p><div class="example"><a name="id2696719"></a><p class="title"><b>Example 2.13. Transactions</b></p><div class="example-contents"><p>C++:</p><pre class="programlisting">
+Connection connection(broker);
+Session session = connection.createTransactionalSession();
+...
+if (smellsOk())
+ session.commit();
+else
+ session.rollback();
+ </pre><p>
+ .NET C#:
+ </p><pre class="programlisting">
+Connection connection = new Connection(broker);
+Session session = connection.CreateTransactionalSession();
+...
+if (smellsOk())
+ session.Commit();
+else
+ session.Rollback();
+</pre></div></div><br class="example-break"><div class="footnotes"><br><hr width="100" align="left"><div class="footnote"><p><sup>[<a name="ftn.id2696709" href="#id2696709" class="para">8</a>] </sup>Note that this currently is only true for
+ messages received using a reliable mode
+ e.g. at-least-once. Messages sent by a broker to a receiver in
+ unreliable receiver will be discarded immediately regardless of
+ transctionality.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s08.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s10.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">2.8. Receiving Messages from Multiple Sources </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 2.10. Connection Options</td></tr></table></div></body></html>
Added: qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s10.html
URL: http://svn.apache.org/viewvc/qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s10.html?rev=1097544&view=auto
==============================================================================
--- qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s10.html (added)
+++ qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s10.html Thu Apr 28 16:49:49 2011
@@ -0,0 +1,128 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>2.10. Connection Options</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="Programming in Apache Qpid"><link rel="up" href="ch02.html" title="Chapter 2. Using the Qpid Messaging API"><link rel="prev" href="ch02s09.html" title="2.9. Transactions"><link rel="next" href="ch02s11.html" title="2.11. Maps and Lists in Message Content"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">2.10. Connection Options</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s09.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Using the Qpid Messaging API</th><td width="20%" align="right"> <a accesskey="n" href="ch02s11.html">Next</a></td></tr></table><hr></div><
div class="section" title="2.10. Connection Options"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="connection-options"></a>2.10. Connection Options</h2></div></div></div><p>
+ Aspects of the connections behaviour can be controlled through
+ specifying connection options. For example, connections can be
+ configured to automatically reconnect if the connection to a
+ broker is lost.
+ </p><div class="example"><a name="id2696772"></a><p class="title"><b>Example 2.14. Specifying Connection Options in C++, Python, and .NET</b></p><div class="example-contents"><p>In C++, these options can be set using <code class="function">Connection::setOption()</code> or by passing in a set of options to the constructor. The options can be passed in as a map or in string form:</p><pre class="programlisting">
+Connection connection("localhost:5672", "{reconnect: true}");
+try {
+ connection.open();
+ !!! SNIP !!!
+ </pre><p>or</p><pre class="programlisting">
+Connection connection("localhost:5672");
+connection.setOption("reconnect", true);
+try {
+ connection.open();
+ !!! SNIP !!!
+ </pre><p>In Python, these options can be set as attributes of the connection or using named arguments in
+ the <code class="function">Connection</code> constructor:</p><pre class="programlisting">
+connection = Connection("localhost:5672", reconnect=True)
+try:
+ connection.open()
+ !!! SNIP !!!
+ </pre><p>or</p><pre class="programlisting">
+connection = Connection("localhost:5672")
+connection.reconnect = True
+try:
+ connection.open()
+ !!! SNIP !!!
+ </pre><p>
+ In .NET, these options can be set using <code class="function">Connection.SetOption()</code> or by passing in a set of options to the constructor. The options can be passed in as a map or in string form:
+ </p><pre class="programlisting">
+Connection connection= new Connection("localhost:5672", "{reconnect: true}");
+try {
+ connection.Open();
+ !!! SNIP !!!
+</pre><p>
+ or
+ </p><pre class="programlisting">
+Connection connection = new Connection("localhost:5672");
+connection.SetOption("reconnect", true);
+try {
+ connection.Open();
+ !!! SNIP !!!
+</pre><p>See the reference documentation for details in each language.</p></div></div><br class="example-break"><p>The following table lists the supported connection options.</p><div class="table"><a name="id2696881"></a><p class="title"><b>Table 2.4. Connection Options</b></p><div class="table-contents"><table summary="Connection Options" width="100%" border="1"><colgroup><col><col><col></colgroup><thead><tr><th>option name</th><th>value type</th><th>semantics</th></tr></thead><tbody><tr><td>
+ username
+ </td><td>
+ string
+ </td><td>
+ The username to use when authenticating to the broker.
+ </td></tr><tr><td>
+ password
+ </td><td>
+ string
+ </td><td>
+ The password to use when authenticating to the broker.
+ </td></tr><tr><td>
+ sasl-mechanism
+ </td><td>
+ string
+ </td><td>
+ The specific SASL mechanism to use with the c++
+ client when authenticating to the broker. Only a
+ single value can be specified at present. [C++ only].
+ </td></tr><tr><td>
+ sasl_mechanisms
+ </td><td>
+ string
+ </td><td>
+ The specific SASL mechanism to use with the python
+ client when authenticating to the broker. The value
+ is a space separated list in order of preference. [Python only].
+ </td></tr><tr><td>
+ reconnect
+ </td><td>
+ boolean
+ </td><td>
+ Transparently reconnect if the connection is lost.
+ </td></tr><tr><td>
+ <code class="literal">reconnect_timeout [Python]</code> <code class="literal">reconnect-timeout [C++]</code>
+ </td><td>
+ integer
+ </td><td>
+ Total number of seconds to continue reconnection attempts before giving up and raising an exception.
+ </td></tr><tr><td>
+ <code class="literal">reconnect_limit [Python]</code> <code class="literal">reconnect-limit [C++]</code>
+ </td><td>
+ integer
+ </td><td>
+ Maximum number of reconnection attempts before giving up and raising an exception.
+ </td></tr><tr><td>
+ <code class="literal">reconnect_interval_min [Python]</code> <code class="literal">reconnect-interval-min [C++]</code>
+ </td><td>
+ integer representing time in seconds
+ </td><td>
+ Minimum number of seconds between reconnection attempts. The first reconnection attempt is made immediately; if that fails, the first reconnection delay is set to the value of <code class="literal">reconnect_interval_min</code>; if that attempt fails, the reconnect interval increases exponentially until a reconnection attempt succeeds or <code class="literal">reconnect_interval_max</code> is reached.
+ </td></tr><tr><td>
+ <code class="literal">reconnect_interval_max [Python]</code> <code class="literal">reconnect-interval-max [C++]</code>
+ </td><td>
+ integer representing time in seconds
+ </td><td>
+ Maximum reconnect interval.
+ </td></tr><tr><td>
+ <code class="literal">reconnect_interval [Python]</code> <code class="literal">reconnect-interval [C++]</code>
+ </td><td>
+ integer representing time in seconds
+ </td><td>
+ Sets both <code class="literal">reconnection_interval_min</code> and <code class="literal">reconnection_interval_max</code> to the same value.
+ </td></tr><tr><td>
+ heartbeat
+ </td><td>
+ integer representing time in seconds
+ </td><td>
+ Requests that heartbeats be sent every N seconds. If two
+ successive heartbeats are missed the connection is
+ considered to be lost.
+ </td></tr><tr><td>
+ protocol
+ </td><td>
+ string
+ </td><td>
+ Sets the underlying protocol used. The default option is 'tcp'. To enable ssl, set to 'ssl'. The C++ client additionally supports 'rdma'.
+ </td></tr><tr><td>
+ tcp-nodelay
+ </td><td>
+ boolean
+ </td><td>
+ Set tcp no-delay, i.e. disable Nagle algorithm. [C++ only]
+ </td></tr></tbody></table></div></div><br class="table-break"></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s09.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s11.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">2.9. Transactions </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 2.11. Maps and Lists in Message Content</td></tr></table></div></body></html>
Added: qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s11.html
URL: http://svn.apache.org/viewvc/qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s11.html?rev=1097544&view=auto
==============================================================================
--- qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s11.html (added)
+++ qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s11.html Thu Apr 28 16:49:49 2011
@@ -0,0 +1,157 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>2.11. Maps and Lists in Message Content</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="Programming in Apache Qpid"><link rel="up" href="ch02.html" title="Chapter 2. Using the Qpid Messaging API"><link rel="prev" href="ch02s10.html" title="2.10. Connection Options"><link rel="next" href="ch02s12.html" title="2.12. The Request / Response Pattern"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">2.11. Maps and Lists in Message Content</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s10.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Using the Qpid Messaging API</th><td width="20%" align="right"> <a accesskey="n" href="ch02s12.html">Nex
t</a></td></tr></table><hr></div><div class="section" title="2.11. Maps and Lists in Message Content"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="section-Maps"></a>2.11. Maps and Lists in Message Content</h2></div></div></div><p>Many messaging applications need to exchange data across
+ languages and platforms, using the native datatypes of each
+ programming language.</p><p>The Qpid Messaging API supports <code class="classname">map</code> and <code class="classname">list</code> in message content.
+
+ <sup>[<a name="id2739905" href="#ftn.id2739905" class="footnote">9</a>]</sup>
+
+ <sup>[<a name="id2739910" href="#ftn.id2739910" class="footnote">10</a>]</sup>
+ Specific language support for <code class="classname">map</code> and <code class="classname">list</code> objects are shown in the following table.
+ </p><div class="table"><a name="tabl-Programming_in_Apache_Qpid-Qpid_Maps_in_Message_Content"></a><p class="title"><b>Table 2.5. Map and List Representation in Supported Languages</b></p><div class="table-contents"><table summary="Map and List Representation in Supported Languages" border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Language</th><th>map</th><th>list</th></tr></thead><tbody><tr><td>Python</td><td><code class="classname">dict</code></td><td><code class="classname">list</code></td></tr><tr><td>C++</td><td><code class="classname">Variant::Map</code></td><td><code class="classname">Variant::List</code></td></tr><tr><td>Java</td><td><code class="classname">MapMessage</code></td><td><code class="classname"> </code></td></tr><tr><td>.NET</td><td><code class="classname">Dictionary<string, object></code></td><td><code class="classname">Collection<object></code></td></tr></tbody></table></div></div><br class="table-break"><p>
+ In all languages, messages are encoded using AMQP's portable datatypes.
+ </p><div class="tip" title="Tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p>Because of the differences in type systems among
+ languages, the simplest way to provide portable messages is to
+ rely on maps, lists, strings, 64 bit signed integers, and
+ doubles for messages that need to be exchanged across languages
+ and platforms.</p></div><div class="section" title="2.11.1. Qpid Maps and Lists in Python"><div class="titlepage"><div><div><h3 class="title"><a name="section-Python-Maps"></a>2.11.1. Qpid Maps and Lists in Python</h3></div></div></div><p>In Python, Qpid supports the <code class="classname">dict</code> and <code class="classname">list</code> types directly in message content. The following code shows how to send these structures in a message:</p><div class="example"><a name="id2740062"></a><p class="title"><b>Example 2.15. Sending Qpid Maps and Lists in Python</b></p><div class="example-contents"><pre class="programlisting">
+from qpid.messaging import *
+# !!! SNIP !!!
+
+content = {'Id' : 987654321, 'name' : 'Widget', 'percent' : 0.99}
+content['colours'] = ['red', 'green', 'white']
+content['dimensions'] = {'length' : 10.2, 'width' : 5.1,'depth' : 2.0};
+content['parts'] = [ [1,2,5], [8,2,5] ]
+content['specs'] = {'colors' : content['colours'],
+ 'dimensions' : content['dimensions'],
+ 'parts' : content['parts'] }
+message = Message(content=content)
+sender.send(message)
+ </pre></div></div><br class="example-break"><p>The following table shows the datatypes that can be sent in a Python map message,
+ and the corresponding datatypes that will be received by clients in Java or C++.</p><div class="table"><a name="table-Python-Maps"></a><p class="title"><b>Table 2.6. Python Datatypes in Maps</b></p><div class="table-contents"><table summary="Python Datatypes in Maps" border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Python Datatype</th><th>→ C++</th><th>→ Java</th></tr></thead><tbody><tr><td>bool</td><td>bool</td><td>boolean</td></tr><tr><td>int</td><td>int64</td><td>long</td></tr><tr><td>long</td><td>int64</td><td>long</td></tr><tr><td>float</td><td>double</td><td>double</td></tr><tr><td>unicode</td><td>string</td><td>java.lang.String</td></tr><tr><td>uuid</td><td>qpid::types::Uuid</td><td>java.util.UUID</td></tr><tr><td>dict</td><td>Variant::Map</td><td>java.util.Map</td></tr><tr><td>list</td><td>Variant::List</td><td>java.util.List</td></tr></tbody></table></div></div><br class="table-break"></div><div class="section" title="2.11.2. Qpid Maps a
nd Lists in C++"><div class="titlepage"><div><div><h3 class="title"><a name="section-cpp-Maps"></a>2.11.2. Qpid Maps and Lists in C++</h3></div></div></div><p>In C++, Qpid defines the the
+ <code class="classname">Variant::Map</code> and
+ <code class="classname">Variant::List</code> types, which can be
+ encoded into message content. The following code shows how to
+ send these structures in a message:</p><div class="example"><a name="id2740229"></a><p class="title"><b>Example 2.16. Sending Qpid Maps and Lists in C++</b></p><div class="example-contents"><pre class="programlisting">
+using namespace qpid::types;
+
+// !!! SNIP !!!
+
+Message message;
+Variant::Map content;
+content["id"] = 987654321;
+content["name"] = "Widget";
+content["percent"] = 0.99;
+Variant::List colours;
+colours.push_back(Variant("red"));
+colours.push_back(Variant("green"));
+colours.push_back(Variant("white"));
+content["colours"] = colours;
+
+Variant::Map dimensions;
+dimensions["length"] = 10.2;
+dimensions["width"] = 5.1;
+dimensions["depth"] = 2.0;
+content["dimensions"]= dimensions;
+
+Variant::List part1;
+part1.push_back(Variant(1));
+part1.push_back(Variant(2));
+part1.push_back(Variant(5));
+
+Variant::List part2;
+part2.push_back(Variant(8));
+part2.push_back(Variant(2));
+part2.push_back(Variant(5));
+
+Variant::List parts;
+parts.push_back(part1);
+parts.push_back(part2);
+content["parts"]= parts;
+
+Variant::Map specs;
+specs["colours"] = colours;
+specs["dimensions"] = dimensions;
+specs["parts"] = parts;
+content["specs"] = specs;
+
+encode(content, message);
+sender.send(message, true);
+ </pre></div></div><br class="example-break"><p>The following table shows the datatypes that can be sent
+ in a C++ map message, and the corresponding datatypes that
+ will be received by clients in Java and Python.</p><div class="table"><a name="table-cpp-Maps"></a><p class="title"><b>Table 2.7. C++ Datatypes in Maps</b></p><div class="table-contents"><table summary="C++ Datatypes in Maps" border="1"><colgroup><col><col><col></colgroup><thead><tr><th>C++ Datatype</th><th>→ Python</th><th>→ Java</th></tr></thead><tbody><tr><td>bool</td><td>bool</td><td>boolean</td></tr><tr><td>uint16</td><td>int | long</td><td>short</td></tr><tr><td>uint32</td><td>int | long</td><td>int</td></tr><tr><td>uint64</td><td>int | long</td><td>long</td></tr><tr><td>int16</td><td>int | long</td><td>short</td></tr><tr><td>int32</td><td>int | long</td><td>int</td></tr><tr><td>int64</td><td>int | long</td><td>long</td></tr><tr><td>float</td><td>float</td><td>float</td></tr><tr><td>double</td><td>float</td><td>double</td></tr><tr><td>string</td><td>unicode</td><td>java.lang.String</td></tr><tr><td>qpid::types::Uuid</td><td>uuid</td><td>java.util.UUID</t
d></tr><tr><td>Variant::Map</td><td>dict</td><td>java.util.Map</td></tr><tr><td>Variant::List</td><td>list</td><td>java.util.List</td></tr></tbody></table></div></div><br class="table-break"></div><div class="section" title="2.11.3. Qpid Maps and Lists in .NET"><div class="titlepage"><div><div><h3 class="title"><a name="section-dotnet-Maps"></a>2.11.3. Qpid Maps and Lists in .NET</h3></div></div></div><p>
+ The .NET binding for the Qpid Messaging API binds .NET managed data types
+ to C++ <code class="classname">Variant</code> data types. The following code shows how to
+ send Map and List structures in a message:
+ </p><div class="example"><a name="id2740446"></a><p class="title"><b>Example 2.17. Sending Qpid Maps and Lists in .NET C#</b></p><div class="example-contents"><pre class="programlisting">
+using System;
+using Org.Apache.Qpid.Messaging;
+
+// !!! SNIP !!!
+
+Dictionary<string, object> content = new Dictionary<string, object>();
+Dictionary<string, object> subMap = new Dictionary<string, object>();
+Collection<object> colors = new Collection<object>();
+
+// add simple types
+content["id"] = 987654321;
+content["name"] = "Widget";
+content["percent"] = 0.99;
+
+// add nested amqp/map
+subMap["name"] = "Smith";
+subMap["number"] = 354;
+content["nestedMap"] = subMap;
+
+// add an amqp/list
+colors.Add("red");
+colors.Add("green");
+colors.Add("white");
+content["colorsList"] = colors;
+
+// add one of each supported amqp data type
+bool mybool = true;
+content["mybool"] = mybool;
+
+byte mybyte = 4;
+content["mybyte"] = mybyte;
+
+UInt16 myUInt16 = 5;
+content["myUInt16"] = myUInt16;
+
+UInt32 myUInt32 = 6;
+content["myUInt32"] = myUInt32;
+
+UInt64 myUInt64 = 7;
+content["myUInt64"] = myUInt64;
+
+char mychar = 'h';
+content["mychar"] = mychar;
+
+Int16 myInt16 = 9;
+content["myInt16"] = myInt16;
+
+Int32 myInt32 = 10;
+content["myInt32"] = myInt32;
+
+Int64 myInt64 = 11;
+content["myInt64"] = myInt64;
+
+Single mySingle = (Single)12.12;
+content["mySingle"] = mySingle;
+
+Double myDouble = 13.13;
+content["myDouble"] = myDouble;
+
+Guid myGuid = new Guid("000102030405060708090a0b0c0d0e0f");
+content["myGuid"] = myGuid;
+
+Message message = new Message(content);
+Send(message, true);
+ </pre></div></div><br class="example-break"><p>
+ The following table shows the mapping between datatypes in .NET and C++.
+ </p><div class="table"><a name="table-dotnet-Maps"></a><p class="title"><b>Table 2.8. Datatype Mapping between C++ and .NET binding</b></p><div class="table-contents"><table summary="Datatype Mapping between C++ and .NET binding" border="1"><colgroup><col><col></colgroup><thead><tr><th>C++ Datatype</th><th>→ .NET binding</th></tr></thead><tbody><tr><td>void</td><td>nullptr</td></tr><tr><td>bool</td><td>bool</td></tr><tr><td>uint8</td><td>byte</td></tr><tr><td>uint16</td><td>UInt16</td></tr><tr><td>uint32</td><td>UInt32</td></tr><tr><td>uint64</td><td>UInt64</td></tr><tr><td>uint8</td><td>char</td></tr><tr><td>int16</td><td>Int16</td></tr><tr><td>int32</td><td>Int32</td></tr><tr><td>int64</td><td>Int64</td></tr><tr><td>float</td><td>Single</td></tr><tr><td>double</td><td>Double</td></tr><tr><td>string</td><td>string
+ <sup>[<a name="callout-dotnet-string" href="#ftn.callout-dotnet-string" class="footnote">a</a>]</sup></td></tr><tr><td>qpid::types::Uuid</td><td>Guid</td></tr><tr><td>Variant::Map</td><td>Dictionary<string, object>
+ <sup>[<a href="ch02s11.html#ftn.callout-dotnet-string" class="footnoteref">a</a>]</sup></td></tr><tr><td>Variant::List</td><td>Collection<object>
+ <sup>[<a href="ch02s11.html#ftn.callout-dotnet-string" class="footnoteref">a</a>]</sup></td></tr></tbody><tbody class="footnotes"><tr><td colspan="2"><div class="footnote"><p><sup>[<a name="ftn.callout-dotnet-string" href="#callout-dotnet-string" class="para">a</a>] </sup>Strings are currently interpreted only with UTF-8 encoding.</p></div></td></tr></tbody></table></div></div><br class="table-break"></div><div class="footnotes"><br><hr width="100" align="left"><div class="footnote"><p><sup>[<a name="ftn.id2739905" href="#id2739905" class="para">9</a>] </sup>Unlike JMS, there is not a specific message type for
+ map messages.</p></div><div class="footnote"><p><sup>[<a name="ftn.id2739910" href="#id2739910" class="para">10</a>] </sup>
+ Note that the Qpid JMS client supports MapMessages whose values can be nested maps or lists. This is not standard JMS behaviour.
+ </p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s10.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s12.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">2.10. Connection Options </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 2.12. The Request / Response Pattern</td></tr></table></div></body></html>
Added: qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s12.html
URL: http://svn.apache.org/viewvc/qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s12.html?rev=1097544&view=auto
==============================================================================
--- qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s12.html (added)
+++ qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s12.html Thu Apr 28 16:49:49 2011
@@ -0,0 +1,42 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>2.12. The Request / Response Pattern</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="Programming in Apache Qpid"><link rel="up" href="ch02.html" title="Chapter 2. Using the Qpid Messaging API"><link rel="prev" href="ch02s11.html" title="2.11. Maps and Lists in Message Content"><link rel="next" href="ch02s13.html" title="2.13. Performance Tips"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">2.12. The Request / Response Pattern</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s11.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Using the Qpid Messaging API</th><td width="20%" align="right"> <a accesskey="n" href="ch02s13.html">Next</a>
</td></tr></table><hr></div><div class="section" title="2.12. The Request / Response Pattern"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2740807"></a>2.12. The Request / Response Pattern</h2></div></div></div><p>Request / Response applications use the reply-to property,
+ described in <a class="xref" href="ch02s16.html#table-amqp0-10-message-properties" title="Table 2.9. Mapping to AMQP 0-10 Message Properties">Table 2.9, “Mapping to AMQP 0-10 Message Properties”</a>, to allow a server
+ to respond to the client that sent a message. A server sets up a
+ service queue, with a name known to clients. A client creates a
+ private queue for the server's response, creates a message for a
+ request, sets the request's reply-to property to the address of
+ the client's response queue, and sends the request to the
+ service queue. The server sends the response to the address
+ specified in the request's reply-to property.
+ </p><div class="example"><a name="id2740830"></a><p class="title"><b>Example 2.18. Request / Response Applications in C++</b></p><div class="example-contents"><p>This example shows the C++ code for a client and server
+ that use the request / response pattern.</p><p>The server creates a service queue and waits for a
+ message to arrive. If it receives a message, it sends a
+ message back to the sender.</p><pre class="programlisting">Receiver receiver = session.createReceiver("service_queue; {create: always}");
+
+Message request = receiver.fetch();
+const Address&amp; address = request.getReplyTo(); // Get "reply-to" from request ...
+if (address) {
+ Sender sender = session.createSender(address); // ... send response to "reply-to"
+ Message response("pong!");
+ sender.send(response);
+ session.acknowledge();
+}
+ </pre><p>The client creates a sender for the service queue, and
+ also creates a response queue that is deleted when the
+ client closes the receiver for the response queue. In the C++
+ client, if the address starts with the character
+ <code class="literal">#</code>, it is given a unique name.</p><pre class="programlisting">
+Sender sender = session.createSender("service_queue");
+
+Address responseQueue("#response-queue; {create:always, delete:always}");
+Receiver receiver = session.createReceiver(responseQueue);
+
+Message request;
+request.setReplyTo(responseQueue);
+request.setContent("ping");
+sender.send(request);
+Message response = receiver.fetch();
+std::cout << request.getContent() << " -> " << response.getContent() << std::endl;
+ </pre><p>The client sends the string <code class="literal">ping</code> to
+ the server. The server sends the response
+ <code class="literal">pong</code> back to the same client, using the
+ <code class="varname">replyTo</code> property.</p></div></div><br class="example-break"></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s11.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s13.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">2.11. Maps and Lists in Message Content </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 2.13. Performance Tips</td></tr></table></div></body></html>
Added: qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s13.html
URL: http://svn.apache.org/viewvc/qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s13.html?rev=1097544&view=auto
==============================================================================
--- qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s13.html (added)
+++ qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s13.html Thu Apr 28 16:49:49 2011
@@ -0,0 +1,22 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>2.13. Performance Tips</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="Programming in Apache Qpid"><link rel="up" href="ch02.html" title="Chapter 2. Using the Qpid Messaging API"><link rel="prev" href="ch02s12.html" title="2.12. The Request / Response Pattern"><link rel="next" href="ch02s14.html" title="2.14. Cluster Failover"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">2.13. Performance Tips</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s12.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Using the Qpid Messaging API</th><td width="20%" align="right"> <a accesskey="n" href="ch02s14.html">Next</a></td></tr></table><hr></div><di
v class="section" title="2.13. Performance Tips"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2740917"></a>2.13. Performance Tips</h2></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Consider prefetching messages for receivers (see
+ <a class="xref" href="ch02s06.html" title="2.6. Receiver Capacity (Prefetch)">Section 2.6, “Receiver Capacity (Prefetch)”</a>). This helps eliminate roundtrips
+ and increases throughput. Prefetch is disabled by default,
+ and enabling it is the most effective means of improving
+ throughput of received messages.</p></li><li class="listitem"><p>Send messages asynchronously. Again, this helps
+ eliminate roundtrips and increases throughput. The C++ and
+ .NET clients send asynchronously by default, however the
+ python client defaults to synchronous sends. </p></li><li class="listitem"><p>Acknowledge messages in batches (see
+ <a class="xref" href="ch02s07.html" title="2.7. Acknowledging Received Messages">Section 2.7, “Acknowledging Received Messages”</a>). Rather than
+ acknowledging each message individually, consider issuing
+ acknowledgements after n messages and/or after a particular
+ duration has elapsed.</p></li><li class="listitem"><p>Tune the sender capacity (see
+ <a class="xref" href="ch02s05.html" title="2.5. Sender Capacity and Replay">Section 2.5, “Sender Capacity and Replay”</a>). If the capacity is too low the
+ sender may block waiting for the broker to confirm receipt
+ of messages, before it can free up more capacity.</p></li><li class="listitem"><p>If you are setting a reply-to address on messages
+ being sent by the c++ client, make sure the address type is
+ set to either queue or topic as appropriate. This avoids the
+ client having to determine which type of node is being
+ refered to, which is required when hanling reply-to in AMQP
+ 0-10. </p></li><li class="listitem"><p>For latency sensitive applications, setting tcp-nodelay
+ on qpidd and on client connections can help reduce the
+ latency.</p></li></ul></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s12.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s14.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">2.12. The Request / Response Pattern </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 2.14. Cluster Failover</td></tr></table></div></body></html>
Added: qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s14.html
URL: http://svn.apache.org/viewvc/qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s14.html?rev=1097544&view=auto
==============================================================================
--- qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s14.html (added)
+++ qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s14.html Thu Apr 28 16:49:49 2011
@@ -0,0 +1,34 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>2.14. Cluster Failover</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="Programming in Apache Qpid"><link rel="up" href="ch02.html" title="Chapter 2. Using the Qpid Messaging API"><link rel="prev" href="ch02s13.html" title="2.13. Performance Tips"><link rel="next" href="ch02s15.html" title="2.15. Logging"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">2.14. Cluster Failover</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s13.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Using the Qpid Messaging API</th><td width="20%" align="right"> <a accesskey="n" href="ch02s15.html">Next</a></td></tr></table><hr></div><div class="section" title
="2.14. Cluster Failover"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2741002"></a>2.14. Cluster Failover</h2></div></div></div><p>The messaging broker can be run in clustering mode, which provides high reliability through replicating state between brokers in the cluster. If one broker in a cluster fails, clients can choose another broker in the cluster and continue their work. Each broker in the cluster also advertises the addresses of all known brokers
+
+<sup>[<a name="id2741015" href="#ftn.id2741015" class="footnote">11</a>]</sup>
+
+. A client can use this information to dynamically keep the list of reconnection urls up to date.</p><p>In C++, the <code class="classname">FailoverUpdates</code> class provides this functionality:</p><div class="example"><a name="id2741030"></a><p class="title"><b>Example 2.19. Tracking cluster membership</b></p><div class="example-contents"><p>In C++:</p><pre class="programlisting">
+#include <qpid/messaging/FailoverUpdates.h>
+...
+Connection connection("localhost:5672");
+connection.setOption("reconnect", true);
+try {
+ connection.open();
+ std::auto_ptr<FailoverUpdates> updates(new FailoverUpdates(connection));
+
+ </pre><p>In python:</p><pre class="programlisting">
+import qpid.messaging.util
+...
+connection = Connection("localhost:5672")
+connection.reconnect = True
+try:
+ connection.open()
+ auto_fetch_reconnect_urls(connection)
+
+ </pre><p>
+ In .NET C#:
+ </p><pre class="programlisting">
+using Org.Apache.Qpid.Messaging;
+...
+connection = new Connection("localhost:5672");
+connection.SetOption("reconnect", true);
+try {
+ connection.Open();
+ FailoverUpdates failover = new FailoverUpdates(connection);
+
+</pre></div></div><br class="example-break"><div class="footnotes"><br><hr width="100" align="left"><div class="footnote"><p><sup>[<a name="ftn.id2741015" href="#id2741015" class="para">11</a>] </sup>This is done via the amq.failover exchange in AMQP 0-10</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s13.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s15.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">2.13. Performance Tips </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 2.15. Logging</td></tr></table></div></body></html>
Added: qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s15.html
URL: http://svn.apache.org/viewvc/qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s15.html?rev=1097544&view=auto
==============================================================================
--- qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s15.html (added)
+++ qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s15.html Thu Apr 28 16:49:49 2011
@@ -0,0 +1,26 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>2.15. Logging</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="Programming in Apache Qpid"><link rel="up" href="ch02.html" title="Chapter 2. Using the Qpid Messaging API"><link rel="prev" href="ch02s14.html" title="2.14. Cluster Failover"><link rel="next" href="ch02s16.html" title="2.16. The AMQP 0-10 mapping"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">2.15. Logging</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s14.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Using the Qpid Messaging API</th><td width="20%" align="right"> <a accesskey="n" href="ch02s16.html">Next</a></td></tr></table><hr></div><div class="section" title="2.
15. Logging"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2741087"></a>2.15. Logging</h2></div></div></div><p>To simplify debugging, Qpid provides a logging facility
+ that prints out messaging events.</p><div class="section" title="2.15.1. Logging in C++"><div class="titlepage"><div><div><h3 class="title"><a name="id2741097"></a>2.15.1. Logging in C++</h3></div></div></div><p>
+ The Qpidd broker and C++ clients can both use environment variables to enable logging. Linux and Windows systems use the same named environment variables and values.
+ </p><p>Use QPID_LOG_ENABLE to set the level of logging you are interested in (trace, debug, info, notice, warning, error, or critical):
+ </p><pre class="screen">
+export QPID_LOG_ENABLE="warning+"
+</pre><p>
+ The Qpidd broker and C++ clients use QPID_LOG_OUTPUT to determine where logging output should be sent. This is either a file name or the special values stderr, stdout, or syslog:
+ </p><pre class="screen">
+export QPID_LOG_TO_FILE="/tmp/myclient.out"
+</pre><p>
+ From a Windows command prompt, use the following command format to set the environment variables:
+ </p><pre class="screen">
+set QPID_LOG_ENABLE=warning+
+set QPID_LOG_TO_FILE=D:\tmp\myclient.out
+</pre></div><div class="section" title="2.15.2. Logging in Python"><div class="titlepage"><div><div><h3 class="title"><a name="id2741146"></a>2.15.2. Logging in Python</h3></div></div></div><p>
+ The Python client library supports logging using the standard Python logging module. The easiest way to do logging is to use the <span class="command"><strong>basicConfig()</strong></span>, which reports all warnings and errors:
+ </p><pre class="programlisting">from logging import basicConfig
+basicConfig()
+</pre><p>
+ Qpidd also provides a convenience method that makes it easy to specify the level of logging desired. For instance, the following code enables logging at the <span class="command"><strong>DEBUG</strong></span> level:
+ </p><pre class="programlisting">from qpid.log import enable, DEBUG
+enable("qpid.messaging.io", DEBUG)
+</pre><p>
+ For more information on Python logging, see <a class="ulink" href="http://docs.python.org/lib/node425.html" target="_top">http://docs.python.org/lib/node425.html</a>. For more information on Qpid logging, use <span class="command"><strong>$ pydoc qpid.log</strong></span>.
+ </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s14.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s16.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">2.14. Cluster Failover </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 2.16. The AMQP 0-10 mapping</td></tr></table></div></body></html>
Added: qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s16.html
URL: http://svn.apache.org/viewvc/qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s16.html?rev=1097544&view=auto
==============================================================================
--- qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s16.html (added)
+++ qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch02s16.html Thu Apr 28 16:49:49 2011
@@ -0,0 +1,124 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>2.16. The AMQP 0-10 mapping</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="Programming in Apache Qpid"><link rel="up" href="ch02.html" title="Chapter 2. Using the Qpid Messaging API"><link rel="prev" href="ch02s15.html" title="2.15. Logging"><link rel="next" href="ch03.html" title="Chapter 3. Using the Qpid JMS client"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">2.16. The AMQP 0-10 mapping</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s15.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Using the Qpid Messaging API</th><td width="20%" align="right"> <a accesskey="n" href="ch03.html">Next</a></td></tr></table><hr></div><div cl
ass="section" title="2.16. The AMQP 0-10 mapping"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="section-amqp0-10-mapping"></a>2.16. The AMQP 0-10 mapping</h2></div></div></div><p>
+ This section describes the AMQP 0-10 mapping for the Qpid
+ Messaging API.
+ </p><p>
+ The interaction with the broker triggered by creating a sender
+ or receiver depends on what the specified address resolves
+ to. Where the node type is not specified in the address, the
+ client queries the broker to determine whether it refers to a
+ queue or an exchange.
+ </p><p>
+ When sending to a queue, the queue's name is set as the
+ routing key and the message is transfered to the default (or
+ nameless) exchange. When sending to an exchange, the message
+ is transfered to that exchange and the routing key is set to
+ the message subject if one is specified. A default subject may
+ be specified in the target address. The subject may also be
+ set on each message individually to override the default if
+ required. In each case any specified subject is also added as
+ a qpid.subject entry in the application-headers field of the
+ message-properties.
+ </p><p>
+ When receiving from a queue, any subject in the source address
+ is currently ignored. The client sends a message-subscribe
+ request for the queue in question. The accept-mode is
+ determined by the reliability option in the link properties;
+ for unreliable links the accept-mode is none, for reliable
+ links it is explicit. The default for a queue is reliable. The
+ acquire-mode is determined by the value of the mode option. If
+ the mode is set to browse the acquire mode is not-acquired,
+ otherwise it is set to pre-acquired. The exclusive and
+ arguments fields in the message-subscribe command can be
+ controlled using the x-subscribe map.
+ </p><p>
+ When receiving from an exchange, the client creates a
+ subscription queue and binds that to the exchange. The
+ subscription queue's arguments can be specified using the
+ x-declare map within the link properties. The reliability
+ option determines most of the other parameters. If the
+ reliability is set to unreliable then an auto-deleted,
+ exclusive queue is used meaning that if the client or
+ connection fails messages may be lost. For exactly-once the
+ queue is not set to be auto-deleted. The durability of the
+ subscription queue is determined by the durable option in the
+ link properties. The binding process depends on the type of
+ the exchange the source address resolves to.
+ </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
+ For a topic exchange, if no subject is specified and no
+ x-bindings are defined for the link, the subscription
+ queue is bound using a wildcard matching any routing key
+ (thus satisfying the expectation that any message sent to
+ that address will be received from it). If a subject is
+ specified in the source address however, it is used for
+ the binding key (this means that the subject in the source
+ address may be a binding pattern including wildcards).
+ </p></li><li class="listitem"><p>
+ For a fanout exchange the binding key is irrelevant to
+ matching. A receiver created from a source address that
+ resolves to a fanout exchange receives all messages
+ sent to that exchange regardless of any subject the source
+ address may contain. An x-bindings element in the link
+ properties should be used if there is any need to set the
+ arguments to the bind.
+ </p></li><li class="listitem"><p>
+ For a direct exchange, the subject is used as the binding
+ key. If no subject is specified an empty string is used as
+ the binding key.
+ </p></li><li class="listitem"><p>
+ For a headers exchange, if no subject is specified the
+ binding arguments simply contain an x-match entry and no
+ other entries, causing all messages to match. If a subject
+ is specified then the binding arguments contain an x-match
+ entry set to all and an entry for qpid.subject whose value
+ is the subject in the source address (this means the
+ subject in the source address must match the message
+ subject exactly). For more control the x-bindings element
+ in the link properties must be used.
+ </p></li><li class="listitem"><p>
+ For the XML exchange,<sup>[<a name="id2741346" href="#ftn.id2741346" class="footnote">12</a>]</sup> if a subject is specified it is
+ used as the binding key and an XQuery is defined that
+ matches any message with that value for
+ qpid.subject. Again this means that only messages whose
+ subject exactly match that specified in the source address
+ are received. If no subject is specified then the empty
+ string is used as the binding key with an xquery that will
+ match any message (this means that only messages with an
+ empty string as the routing key will be received). For more
+ control the x-bindings element in the link properties must
+ be used. A source address that resolves to the XML
+ exchange must contain either a subject or an x-bindings
+ element in the link properties as there is no way at
+ present to receive any message regardless of routing key.
+ </p></li></ul></div><p>
+ If an x-bindings list is present in the link options a binding
+ is created for each element within that list. Each element is
+ a nested map that may contain values named queue, exchange,
+ key or arguments. If the queue value is absent the queue name
+ the address resolves to is implied. If the exchange value is
+ absent the exchange name the address resolves to is implied.
+ </p><p>The following table shows how Qpid Messaging API message
+ properties are mapped to AMQP 0-10 message properties and
+ delivery properties. In this table <code class="varname">msg</code>
+ refers to the Message class defined in the Qpid Messaging API,
+ <code class="varname">mp</code> refers to an AMQP 0-10
+ <code class="varname">message-properties</code> struct, and
+ <code class="varname">dp</code> refers to an AMQP 0-10
+ <code class="varname">delivery-properties</code> struct.</p><div class="table"><a name="table-amqp0-10-message-properties"></a><p class="title"><b>Table 2.9. Mapping to AMQP 0-10 Message Properties</b></p><div class="table-contents"><table summary="Mapping to AMQP 0-10 Message Properties" width="100%" border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Python API</th><th>C++ API
+ <sup>[<a name="id2741458" href="#ftn.id2741458" class="footnote">a</a>]</sup>
+ </th><th>AMQP 0-10 Property<sup>[<a name="id2741475" href="#ftn.id2741475" class="footnote">b</a>]</sup></th></tr></thead><tbody><tr><td>msg.id</td><td>msg.{get,set}MessageId()</td><td>mp.message_id</td></tr><tr><td>msg.subject</td><td>msg.{get,set}Subject()</td><td>mp.application_headers["qpid.subject"]</td></tr><tr><td>msg.user_id</td><td>msg.{get,set}UserId()</td><td>mp.user_id</td></tr><tr><td>msg.reply_to</td><td>msg.{get,set}ReplyTo()</td><td>mp.reply_to<sup>[<a name="id2741537" href="#ftn.id2741537" class="footnote">c</a>]</sup></td></tr><tr><td>msg.correlation_id</td><td>msg.{get,set}CorrelationId()</td><td>mp.correlation_id</td></tr><tr><td>msg.durable</td><td>msg.{get,set}Durable()</td><td>dp.delivery_mode == delivery_mode.persistent<sup>[<a name="id2741564" href="#ftn.id2741564" class="footnote">d</a>]</sup></td></tr><tr><td>msg.priority</td><td>msg.{get,set}Priority()</td><td>dp.priority</td></tr><tr><td>msg.ttl</td><td>msg.{get,set}Ttl()</td><td>dp.ttl</t
d></tr><tr><td>msg.redelivered</td><td>msg.{get,set}Redelivered()</td><td>dp.redelivered</td></tr><tr><td>msg.properties</td><td>msg.{get,set}Properties()</td><td>mp.application_headers</td></tr><tr><td>msg.content_type</td><td>msg.{get,set}ContentType()</td><td>mp.content_type</td></tr></tbody><tbody class="footnotes"><tr><td colspan="3"><div class="footnote"><p><sup>[<a name="ftn.id2741458" href="#id2741458" class="para">a</a>] </sup>
+ The .NET Binding for C++ Messaging provides all the
+ message and delivery properties described in the C++ API.
+ See <a class="xref" href="ch05s03.html#table-Dotnet-Binding-Message" title="Table 5.13. .NET Binding for the C++ Messaging API Class: Message">Table 5.13, “.NET Binding for the C++ Messaging API Class: Message”</a> .
+ </p></div><div class="footnote"><p><sup>[<a name="ftn.id2741475" href="#id2741475" class="para">b</a>] </sup>In these entries, <code class="literal">mp</code> refers to an AMQP message property, and <code class="literal">dp</code> refers to an AMQP delivery property.</p></div><div class="footnote"><p><sup>[<a name="ftn.id2741537" href="#id2741537" class="para">c</a>] </sup>The reply_to is converted from the protocol representation into an address.</p></div><div class="footnote"><p><sup>[<a name="ftn.id2741564" href="#id2741564" class="para">d</a>] </sup>Note that msg.durable is a boolean, not an enum.</p></div></td></tr></tbody></table></div></div><br class="table-break"><p>The 0-10 mapping also recognises certain special property
+ keys. If the properties contain entries for <code class="literal">x-amqp-0-10.app-id</code>
+ or <code class="literal">x-amqp-0-10.content-encoding</code>, the values will be used to
+ set <code class="literal">message-properties.app-id</code> and
+ <code class="literal">message-properties.content-encoding</code> on the
+ resulting 0-10 message transfer. Likewise if an incoming
+ transfer has those properties set, they will be exposed in the
+ same manner. In addition the routing key on incoming transfers
+ will be exposed directly via the custom property with key
+ <code class="literal">x-amqp-0-10.routing-key</code>.</p><div class="footnotes"><br><hr width="100" align="left"><div class="footnote"><p><sup>[<a name="ftn.id2741346" href="#id2741346" class="para">12</a>] </sup>Note that the XML
+ exchange is not a standard AMQP exchange type. It is a
+ Qpid extension and is currently only supported by the C++
+ broker.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s15.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">2.15. Logging </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 3. Using the Qpid JMS client</td></tr></table></div></body></html>
Added: qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch03.html
URL: http://svn.apache.org/viewvc/qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch03.html?rev=1097544&view=auto
==============================================================================
--- qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch03.html (added)
+++ qpid/site/docs/books/0.10/Programming-In-Apache-Qpid/html/ch03.html Thu Apr 28 16:49:49 2011
@@ -0,0 +1,78 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 3. Using the Qpid JMS client</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="Programming in Apache Qpid"><link rel="up" href="index.html" title="Programming in Apache Qpid"><link rel="prev" href="ch02s16.html" title="2.16. The AMQP 0-10 mapping"><link rel="next" href="ch03s02.html" title="3.2. Apache Qpid JNDI Properties for AMQP Messaging"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 3. Using the Qpid JMS client</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s16.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch03s02.html">Next</a></td></tr></table><hr></div><div c
lass="chapter" title="Chapter 3. Using the Qpid JMS client"><div class="titlepage"><div><div><h2 class="title"><a name="QpidJMS"></a>Chapter 3. Using the Qpid JMS client</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="ch03.html#id2741673">3.1. A Simple Messaging Program in Java JMS</a></span></dt><dt><span class="section"><a href="ch03s02.html">3.2. Apache Qpid JNDI Properties for AMQP Messaging</a></span></dt><dd><dl><dt><span class="section"><a href="ch03s02.html#id2742086">3.2.1. JNDI Properties for Apache Qpid</a></span></dt><dt><span class="section"><a href="ch03s02.html#section-jms-connection-url">3.2.2. Connection URLs</a></span></dt></dl></dd><dt><span class="section"><a href="ch03s03.html">3.3. Java JMS Message Properties</a></span></dt><dt><span class="section"><a href="ch03s04.html">3.4. JMS MapMessage Types</a></span></dt><dt><span class="section"><a href="ch03s05.html">3.5. JMS Client Logging</a></
span></dt><dt><span class="section"><a href="ch03s06.html">3.6. Configuring the JMS Client</a></span></dt><dd><dl><dt><span class="section"><a href="ch03s06.html#id2743246">3.6.1. Qpid JVM Arguments</a></span></dt></dl></dd></dl></div><div class="section" title="3.1. A Simple Messaging Program in Java JMS"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2741673"></a>3.1. A Simple Messaging Program in Java JMS</h2></div></div></div><p>The following program shows how to send and receive a
+ message using the Qpid JMS client. JMS programs typically use
+ JNDI to obtain connection factory and destination objects which
+ the application needs. In this way the configuration is kept
+ separate from the application code itself.</p><p>In this example, we create a JNDI context using a
+ properties file, use the context to lookup a connection factory,
+ create and start a connection, create a session, and lookup a
+ destination from the JNDI context. Then we create a producer and
+ a consumer, send a message with the producer and receive it with
+ the consumer. This code should be straightforward for anyone
+ familiar with Java JMS.</p><div class="example"><a name="id2741698"></a><p class="title"><b>Example 3.1. "Hello world!" in Java</b></p><div class="example-contents"><pre lang="java" class="programlisting">
+package org.apache.qpid.example.jmsexample.hello;
+
+import javax.jms.*;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import java.util.Properties;
+
+public class Hello {
+
+ public Hello() {
+ }
+
+ public static void main(String[] args) {
+ Hello producer = new Hello();
+ producer.runTest();
+ }
+
+ private void runTest() {
+ try {
+ Properties properties = new Properties();
+ properties.load(this.getClass().getResourceAsStream("hello.properties")); <a class="co" name="hello-java-properties" href="ch03.html#callout-java-properties">(1)</a>
+ Context context = new InitialContext(properties); <a class="co" name="hello-java-context" href="ch03.html#callout-java-context">(2)</a>
+
+ ConnectionFactory connectionFactory
+ = (ConnectionFactory) context.lookup("qpidConnectionfactory"); <a class="co" name="hello-java-connection-factory" href="ch03.html#callout-java-connection-factory">(3)</a>
+ Connection connection = connectionFactory.createConnection(); <a class="co" name="hello-java-connection" href="ch03.html#callout-java-connection">(4)</a>
+ connection.start(); <a class="co" name="hello-java-start" href="ch03.html#callout-java-start">(5)</a>
+
+ Session session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);<a class="co" name="hello-java-session" href="ch03.html#callout-java-session">(6)</a>
+ Destination destination = (Destination) context.lookup("topicExchange"); <a class="co" name="hello-java-destination" href="ch03.html#callout-java-destination">(7)</a>
+
+ MessageProducer messageProducer = session.createProducer(destination); <a class="co" name="hello-java-producer" href="ch03.html#callout-java-producer">(8)</a>
+ MessageConsumer messageConsumer = session.createConsumer(destination); <a class="co" name="hello-java-consumer" href="ch03.html#callout-java-consumer">(9)</a>
+
+ TextMessage message = session.createTextMessage("Hello world!");
+ messageProducer.send(message);
+
+ message = (TextMessage)messageConsumer.receive(); <a class="co" name="hello-java-receive" href="ch03.html#callout-java-receive">(10)</a>
+ System.out.println(message.getText());
+
+ connection.close(); <a class="co" name="hello-java-close" href="ch03.html#callout-java-close">(11)</a>
+ context.close(); <a class="co" name="hello-java-jndi-close" href="ch03.html#callout-java-jndi-close">(12)</a>
+ }
+ catch (Exception exp) {
+ exp.printStackTrace();
+ }
+ }
+}
+ </pre></div></div><br class="example-break"><div class="calloutlist"><table border="0" summary="Callout list"><tr><td width="5%" valign="top" align="left"><p><a name="callout-java-properties"></a><a href="#hello-java-properties">(1)</a> </p></td><td valign="top" align="left"><p>Loads the JNDI properties file, which specifies connection properties, queues, topics, and addressing options. See <a class="xref" href="ch03s02.html" title="3.2. Apache Qpid JNDI Properties for AMQP Messaging">Section 3.2, “Apache Qpid JNDI Properties for AMQP Messaging”</a> for details.</p></td></tr><tr><td width="5%" valign="top" align="left"><p><a name="callout-java-context"></a><a href="#hello-java-context">(2)</a> </p></td><td valign="top" align="left"><p>Creates the JNDI initial context.</p></td></tr><tr><td width="5%" valign="top" align="left"><p><a name="callout-java-connection-factory"></a><a href="#hello-java-connection-factory">(3)</a> </p></td><td valign="top" align="left">
<p>Creates a JMS connection factory for Qpid.</p></td></tr><tr><td width="5%" valign="top" align="left"><p><a name="callout-java-connection"></a><a href="#hello-java-connection">(4)</a> </p></td><td valign="top" align="left"><p>Creates a JMS connection.</p></td></tr><tr><td width="5%" valign="top" align="left"><p><a name="callout-java-start"></a><a href="#hello-java-start">(5)</a> </p></td><td valign="top" align="left"><p>Activates the connection.</p></td></tr><tr><td width="5%" valign="top" align="left"><p><a name="callout-java-session"></a><a href="#hello-java-session">(6)</a> </p></td><td valign="top" align="left"><p>Creates a session. This session is not transactional (transactions='false'), and messages are automatically acknowledged.</p></td></tr><tr><td width="5%" valign="top" align="left"><p><a name="callout-java-destination"></a><a href="#hello-java-destination">(7)</a> </p></td><td valign="top" align="left"><p>Creates a destination for the topic exchange, so sender
s and receivers can use it.</p></td></tr><tr><td width="5%" valign="top" align="left"><p><a name="callout-java-producer"></a><a href="#hello-java-producer">(8)</a> </p></td><td valign="top" align="left"><p>Creates a producer that sends messages to the topic exchange.</p></td></tr><tr><td width="5%" valign="top" align="left"><p><a name="callout-java-consumer"></a><a href="#hello-java-consumer">(9)</a> </p></td><td valign="top" align="left"><p>Creates a consumer that reads messages from the topic exchange.</p></td></tr><tr><td width="5%" valign="top" align="left"><p><a name="callout-java-receive"></a><a href="#hello-java-receive">(10)</a> </p></td><td valign="top" align="left"><p>Reads the next available message.</p></td></tr><tr><td width="5%" valign="top" align="left"><p><a name="callout-java-close"></a><a href="#hello-java-close">(11)</a> </p></td><td valign="top" align="left"><p>Closes the connection, all sessions managed by the connection, and all senders and receivers ma
naged by each session.</p></td></tr><tr><td width="5%" valign="top" align="left"><p><a name="callout-java-jndi-close"></a><a href="#hello-java-jndi-close">(12)</a> </p></td><td valign="top" align="left"><p>Closes the JNDI context.</p></td></tr></table></div><p>The contents of the hello.properties file are shown below.</p><div class="example"><a name="id2741965"></a><p class="title"><b>Example 3.2. JNDI Properties File for "Hello world!" example</b></p><div class="example-contents"><pre class="programlisting">
+java.naming.factory.initial
+ = org.apache.qpid.jndi.PropertiesFileInitialContextFactory
+
+# connectionfactory.[jndiname] = [ConnectionURL]
+connectionfactory.qpidConnectionfactory
+ = amqp://guest:guest@clientid/test?brokerlist='tcp://localhost:5672' <a class="co" name="hello-properties-connectionfactory" href="ch03.html#callout-hello-properties-connectionfactory">(1)</a>
+# destination.[jndiname] = [address_string]
+destination.topicExchange = amq.topic <a class="co" name="hello-properties-destination" href="ch03.html#callout-hello-properties-destination">(2)</a>
+ </pre></div></div><br class="example-break"><div class="calloutlist"><table border="0" summary="Callout list"><tr><td width="5%" valign="top" align="left"><p><a name="callout-hello-properties-connectionfactory"></a><a href="#hello-properties-connectionfactory">(1)</a> </p></td><td valign="top" align="left"><p>Defines a connection factory from which connections
+ can be created. The syntax of a ConnectionURL is given in
+ <a class="xref" href="ch03s02.html" title="3.2. Apache Qpid JNDI Properties for AMQP Messaging">Section 3.2, “Apache Qpid JNDI Properties for AMQP Messaging”</a>.</p></td></tr><tr><td width="5%" valign="top" align="left"><p><a name="callout-hello-properties-destination"></a><a href="#hello-properties-destination">(2)</a> </p></td><td valign="top" align="left"><p>Defines a destination for which MessageProducers
+ and/or MessageConsumers can be created to send and receive
+ messages. The value for the destination in the properties
+ file is an address string as described in
+ <a class="xref" href="ch02s04.html" title="2.4. Addresses">Section 2.4, “Addresses”</a>. In the JMS
+ implementation MessageProducers are analogous to senders in
+ the Qpid Message API, and MessageConsumers are analogous to
+ receivers.</p></td></tr></table></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s16.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="ch03s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">2.16. The AMQP 0-10 mapping </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 3.2. Apache Qpid JNDI Properties for AMQP Messaging</td></tr></table></div></body></html>
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org