You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2012/11/25 22:12:32 UTC
svn commit: r1413422 [15/19] - in /qpid/site/docs/books/0.20: ./
AMQP-Messaging-Broker-CPP-Book/ AMQP-Messaging-Broker-CPP-Book/html/
AMQP-Messaging-Broker-CPP-Book/html/css/
AMQP-Messaging-Broker-CPP-Book/html/images/
AMQP-Messaging-Broker-CPP-Book/pd...
Added: qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/acknowledgements.html
URL: http://svn.apache.org/viewvc/qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/acknowledgements.html?rev=1413422&view=auto
==============================================================================
--- qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/acknowledgements.html (added)
+++ qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/acknowledgements.html Sun Nov 25 21:12:24 2012
@@ -0,0 +1,21 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>2.7. Acknowledging Received Messages</title><link rel="stylesheet" href="css/style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" 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="prefetch.html" title="2.6. Receiver Capacity (Prefetch)"><link rel="next" href="ch02s08.html" title="2.8. Receiving Messages from Multiple Sources"></head><body><div class="container" bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><DIV class="header"><DIV class="logo"><H1>Apache Qpidâ¢</H1><H2>Open Source AMQP Messaging</H2></DIV></DIV><DIV class="menu_box"><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Apache Qpid</H3><UL><LI><A href="http://qpid.apache.org/index.html">Home</A></LI><LI><A h
ref="http://qpid.apache.org/download.html">Download</A></LI><LI><A href="http://qpid.apache.org/getting_started.html">Getting Started</A></LI><LI><A href="http://www.apache.org/licenses/">License</A></LI><LI><A href="https://cwiki.apache.org/qpid/faq.html">FAQ</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Documentation</H3><UL><LI><A href="http://qpid.apache.org/documentation.html#doc-release">Latest Release</A></LI><LI><A href="http://qpid.apache.org/documentation.html#doc-trunk">Trunk</A></LI><LI><A href="http://qpid.apache.org/documentation.html#doc-archives">Archive</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Community</H3><UL><LI><A href="http://qpid.apache.org/getting_involved.html">Getting Involved</A></LI><LI><A href="http://qpid.apache.org/source_repository.html">Source Repository</A></LI><LI><A href="http://qpid.apache.org/
mailing_lists.html">Mailing Lists</A></LI><LI><A href="https://cwiki.apache.org/qpid/">Wiki</A></LI><LI><A href="https://issues.apache.org/jira/browse/qpid">Issue Reporting</A></LI><LI><A href="http://qpid.apache.org/people.html">People</A></LI><LI><A href="http://qpid.apache.org/acknowledgements.html">Acknowledgements</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Developers</H3><UL><LI><A href="https://cwiki.apache.org/qpid/building.html">Building Qpid</A></LI><LI><A href="https://cwiki.apache.org/qpid/developer-pages.html">Developer Pages</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>About AMQP</H3><UL><LI><A href="http://qpid.apache.org/amqp.html">What is AMQP?</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>About Apache</H3><UL><LI><A href="http://www.apache.org">
Home</A></LI><LI><A href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</A></LI><LI><A href="http://www.apache.org/foundation/thanks.html">Thanks</A></LI><LI><A href="http://www.apache.org/security/">Security</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV></DIV><div class="main_text_area"><div class="main_text_area_top"></div><div class="main_text_area_body"><DIV class="breadcrumbs"><span class="breadcrumb-link"><a href="index.html">Programming in Apache Qpid</a></span> > <span class="breadcrumb-link"><a href="ch02.html">Using the Qpid Messaging API</a></span> > <span class="breadcrumb-node">Acknowledging Received Messages</span></DIV><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title"><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="section-addresses.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><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="prefetch.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><div class="main_text_area_bottom"></div></div></div></body></html>
Added: qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch01.html
URL: http://svn.apache.org/viewvc/qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch01.html?rev=1413422&view=auto
==============================================================================
--- qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch01.html (added)
+++ qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch01.html Sun Nov 25 21:12:24 2012
@@ -0,0 +1,18 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Chapter 1. Introduction</title><link rel="stylesheet" href="css/style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="Programming in Apache Qpid"><link rel="up" href="index.html" title="Programming in Apache Qpid"><link rel="prev" href="index.html" title="Programming in Apache Qpid"><link rel="next" href="ch02.html" title="Chapter 2. Using the Qpid Messaging API"></head><body><div class="container" bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><DIV class="header"><DIV class="logo"><H1>Apache Qpidâ¢</H1><H2>Open Source AMQP Messaging</H2></DIV></DIV><DIV class="menu_box"><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Apache Qpid</H3><UL><LI><A href="http://qpid.apache.org/index.html">Home</A></LI><LI><A href="http://qpid.apache.org/download.html">Down
load</A></LI><LI><A href="http://qpid.apache.org/getting_started.html">Getting Started</A></LI><LI><A href="http://www.apache.org/licenses/">License</A></LI><LI><A href="https://cwiki.apache.org/qpid/faq.html">FAQ</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Documentation</H3><UL><LI><A href="http://qpid.apache.org/documentation.html#doc-release">Latest Release</A></LI><LI><A href="http://qpid.apache.org/documentation.html#doc-trunk">Trunk</A></LI><LI><A href="http://qpid.apache.org/documentation.html#doc-archives">Archive</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Community</H3><UL><LI><A href="http://qpid.apache.org/getting_involved.html">Getting Involved</A></LI><LI><A href="http://qpid.apache.org/source_repository.html">Source Repository</A></LI><LI><A href="http://qpid.apache.org/mailing_lists.html">Mailing Lists</A></LI><LI><
A href="https://cwiki.apache.org/qpid/">Wiki</A></LI><LI><A href="https://issues.apache.org/jira/browse/qpid">Issue Reporting</A></LI><LI><A href="http://qpid.apache.org/people.html">People</A></LI><LI><A href="http://qpid.apache.org/acknowledgements.html">Acknowledgements</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Developers</H3><UL><LI><A href="https://cwiki.apache.org/qpid/building.html">Building Qpid</A></LI><LI><A href="https://cwiki.apache.org/qpid/developer-pages.html">Developer Pages</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>About AMQP</H3><UL><LI><A href="http://qpid.apache.org/amqp.html">What is AMQP?</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>About Apache</H3><UL><LI><A href="http://www.apache.org">Home</A></LI><LI><A href="http://www.apache.org
/foundation/sponsorship.html">Sponsorship</A></LI><LI><A href="http://www.apache.org/foundation/thanks.html">Thanks</A></LI><LI><A href="http://www.apache.org/security/">Security</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV></DIV><div class="main_text_area"><div class="main_text_area_top"></div><div class="main_text_area_body"><DIV class="breadcrumbs"><span class="breadcrumb-link"><a href="index.html">Programming in Apache Qpid</a></span> > <span class="breadcrumb-node">Introduction</span></DIV><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="id2516286"></a>Chapter 1. Introduction</h2></div></div></div><p>Apache Qpid is a reliable, asynchronous messaging system that
+ supports the AMQP messaging protocol in several common programming
+ languages. Qpid is supported on most common platforms.
+ </p><div class="itemizedlist"><ul><li><p>
+ On the Java platform, Qpid uses the
+ established <a class="ulink" href="http://java.sun.com/products/jms/" target="_top">Java JMS
+ API</a>.
+ </p></li><li><p>
+ For Python, C++, and .NET, Qpid defines its own messaging API, the
+ <em class="firstterm">Qpid Messaging API</em>, which is
+ conceptually similar in each.
+ </p><p>
+ On the .NET platform, Qpid also provides a WCF binding.
+ </p></li><li><p>
+ Ruby will also use the Qpid Messaging API, which will soon
+ be implemented. (Ruby currently uses an API that is closely
+ tied to the AMQP version).
+ </p></li></ul></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="index.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="ch02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Programming in Apache Qpid </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 2. Using the Qpid Messaging API</td></tr></table></div><div class="main_text_area_bottom"></div></div></div></body></html>
Added: qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02.html
URL: http://svn.apache.org/viewvc/qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02.html?rev=1413422&view=auto
==============================================================================
--- qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02.html (added)
+++ qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02.html Sun Nov 25 21:12:24 2012
@@ -0,0 +1,70 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Chapter 2. Using the Qpid Messaging API</title><link rel="stylesheet" href="css/style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="Programming in Apache Qpid"><link rel="up" href="index.html" title="Programming in Apache Qpid"><link rel="prev" href="ch01.html" title="Chapter 1. Introduction"><link rel="next" href="ch02s02.html" title="2.2. A Simple Messaging Program in Python"></head><body><div class="container" bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><DIV class="header"><DIV class="logo"><H1>Apache Qpidâ¢</H1><H2>Open Source AMQP Messaging</H2></DIV></DIV><DIV class="menu_box"><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Apache Qpid</H3><UL><LI><A href="http://qpid.apache.org/index.html">Home</A></LI><LI><A href="http://qpid.apache.org
/download.html">Download</A></LI><LI><A href="http://qpid.apache.org/getting_started.html">Getting Started</A></LI><LI><A href="http://www.apache.org/licenses/">License</A></LI><LI><A href="https://cwiki.apache.org/qpid/faq.html">FAQ</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Documentation</H3><UL><LI><A href="http://qpid.apache.org/documentation.html#doc-release">Latest Release</A></LI><LI><A href="http://qpid.apache.org/documentation.html#doc-trunk">Trunk</A></LI><LI><A href="http://qpid.apache.org/documentation.html#doc-archives">Archive</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Community</H3><UL><LI><A href="http://qpid.apache.org/getting_involved.html">Getting Involved</A></LI><LI><A href="http://qpid.apache.org/source_repository.html">Source Repository</A></LI><LI><A href="http://qpid.apache.org/mailing_lists.html">Mailing
Lists</A></LI><LI><A href="https://cwiki.apache.org/qpid/">Wiki</A></LI><LI><A href="https://issues.apache.org/jira/browse/qpid">Issue Reporting</A></LI><LI><A href="http://qpid.apache.org/people.html">People</A></LI><LI><A href="http://qpid.apache.org/acknowledgements.html">Acknowledgements</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Developers</H3><UL><LI><A href="https://cwiki.apache.org/qpid/building.html">Building Qpid</A></LI><LI><A href="https://cwiki.apache.org/qpid/developer-pages.html">Developer Pages</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>About AMQP</H3><UL><LI><A href="http://qpid.apache.org/amqp.html">What is AMQP?</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>About Apache</H3><UL><LI><A href="http://www.apache.org">Home</A></LI><LI><A href="h
ttp://www.apache.org/foundation/sponsorship.html">Sponsorship</A></LI><LI><A href="http://www.apache.org/foundation/thanks.html">Thanks</A></LI><LI><A href="http://www.apache.org/security/">Security</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV></DIV><div class="main_text_area"><div class="main_text_area_top"></div><div class="main_text_area_body"><DIV class="breadcrumbs"><span class="breadcrumb-link"><a href="index.html">Programming in Apache Qpid</a></span> > <span class="breadcrumb-node">Using the Qpid Messaging API</span></DIV><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="id2550429"></a>Chapter 2. Using the Qpid Messaging API</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="ch02.html#id2531116">2.1. A Simple Messaging Program in C++</a></span></dt><dt><span class="section"><a href="ch02s02.html">2.2. A Simple Messaging Program in Python</a></span></dt
><dt><span class="section"><a href="ch02s03.html">2.3. A Simple Messaging Program in .NET C#</a></span></dt><dt><span class="section"><a href="section-addresses.html">2.4. Addresses</a></span></dt><dd><dl><dt><span class="section"><a href="section-addresses.html#id2516584">2.4.1. Address Strings</a></span></dt><dt><span class="section"><a href="section-addresses.html#id2522247">2.4.2. Subjects</a></span></dt><dt><span class="section"><a href="section-addresses.html#id2541123">2.4.3. Address String Options</a></span></dt><dt><span class="section"><a href="section-addresses.html#section-address-string-bnf">2.4.4. Address String Grammar</a></span></dt></dl></dd><dt><span class="section"><a href="replay.html">2.5. Sender Capacity and Replay</a></span></dt><dt><span class="section"><a href="prefetch.html">2.6. Receiver Capacity (Prefetch)</a></span></dt><dt><span class="section"><a href="acknowledgements.html">2.7. Acknowledging Received Messages</a></span></dt><dt><span class="s
ection"><a href="ch02s08.html">2.8. Receiving Messages from Multiple Sources</a></span></dt><dt><span class="section"><a href="ch02s09.html">2.9. Transactions</a></span></dt><dt><span class="section"><a href="connection-options.html">2.10. Connection Options</a></span></dt><dt><span class="section"><a href="section-Maps.html">2.11. Maps and Lists in Message Content</a></span></dt><dd><dl><dt><span class="section"><a href="section-Maps.html#section-Python-Maps">2.11.1. Qpid Maps and Lists in Python</a></span></dt><dt><span class="section"><a href="section-Maps.html#section-cpp-Maps">2.11.2. Qpid Maps and Lists in C++</a></span></dt><dt><span class="section"><a href="section-Maps.html#section-dotnet-Maps">2.11.3. Qpid Maps and Lists in .NET</a></span></dt></dl></dd><dt><span class="section"><a href="ch02s12.html">2.12. The Request / Response Pattern</a></span></dt><dt><span class="section"><a href="ch02s13.html">2.13. Performance Tips</a></span></dt><dt><span class="section"><
a href="ch02s14.html">2.14. Cluster Failover</a></span></dt><dt><span class="section"><a href="ch02s15.html">2.15. Logging</a></span></dt><dd><dl><dt><span class="section"><a href="ch02s15.html#id2552652">2.15.1. Logging in C++</a></span></dt><dt><span class="section"><a href="ch02s15.html#id2552701">2.15.2. Logging in Python</a></span></dt></dl></dd><dt><span class="section"><a href="section-amqp0-10-mapping.html">2.16. The AMQP 0-10 mapping</a></span></dt><dd><dl><dt><span class="section"><a href="section-amqp0-10-mapping.html#section-amqp0-10-message-props">2.16.1. 0-10 Message Property Keys</a></span></dt></dl></dd><dt><span class="section"><a href="Message-Groups-Guide.html">2.17. Using Message Groups</a></span></dt><dd><dl><dt><span class="section"><a href="Message-Groups-Guide.html#messagegroups-setup">2.17.1. Creating Message Group Queues</a></span></dt><dt><span class="section"><a href="Message-Groups-Guide.html#messagegroups-sending">2.17.2. Sending Grouped Message
s</a></span></dt><dt><span class="section"><a href="Message-Groups-Guide.html#messagegroups-receiving">2.17.3. Receiving Grouped Messages</a></span></dt></dl></dd></dl></div><p>The Qpid Messaging API is quite simple, consisting of only a
+ handful of core classes.
+ </p><div class="itemizedlist"><ul><li><p>
+ A <em class="firstterm">message</em> consists of a standard set
+ of fields (e.g. <code class="literal">subject</code>,
+ <code class="literal">reply-to</code>), an application-defined set of
+ properties, and message content (the main body of the
+ message).
+ </p></li><li><p>
+ A <em class="firstterm">connection</em> represents a network
+ connection to a remote endpoint.
+ </p></li><li><p>
+ A <em class="firstterm">session</em> provides a sequentially
+ ordered context for sending and receiving
+ <span class="emphasis"><em>messages</em></span>. A session is obtained from a
+ connection.
+ </p></li><li><p>
+ A <em class="firstterm">sender</em> sends messages to a target
+ using the <code class="literal">sender.send</code> method. A sender is
+ obtained from a session for a given target address.
+ </p></li><li><p>
+ A <em class="firstterm">receiver</em> receives messages from a
+ source using the <code class="literal">receiver.fetch</code> method.
+ A receiver is obtained from a session for a given source
+ address.
+ </p></li></ul></div><p>
+ The following sections show how to use these classes in a
+ simple messaging program.
+ </p><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="id2531116"></a>2.1. A Simple Messaging Program in C++</h2></div></div></div><p>The following C++ program shows how to create a connection,
+ create a session, send messages using a sender, and receive
+ messages using a receiver.</p><div class="example"><a name="id2514065"></a><p class="title"><b>Example 2.1. "Hello world!" in C++</b></p><div class="example-contents"><pre class="programlisting">
+ #include <qpid/messaging/Connection.h>
+ #include <qpid/messaging/Message.h>
+ #include <qpid/messaging/Receiver.h>
+ #include <qpid/messaging/Sender.h>
+ #include <qpid/messaging/Session.h>
+
+ #include <iostream>
+
+ using namespace qpid::messaging;
+
+ int main(int argc, char** argv) {
+ std::string broker = argc > 1 ? argv[1] : "localhost:5672";
+ std::string address = argc > 2 ? argv[2] : "amq.topic";
+ std::string connectionOptions = argc > 3 ? argv[3] : "";
+
+ Connection connection(broker, connectionOptions);
+ try {
+ connection.open(); <a class="co" name="hello-cpp-open" href="ch02.html#callout-cpp-open">(1)</a>
+ Session session = connection.createSession(); <a class="co" name="hello-cpp-session" href="ch02.html#callout-cpp-session">(2)</a>
+
+ Receiver receiver = session.createReceiver(address); <a class="co" name="hello-cpp-receiver" href="ch02.html#callout-cpp-receiver">(3)</a>
+ Sender sender = session.createSender(address); <a class="co" name="hello-cpp-sender" href="ch02.html#callout-cpp-sender">(4)</a>
+
+ sender.send(Message("Hello world!"));
+
+ Message message = receiver.fetch(Duration::SECOND * 1); <a class="co" name="hello-cpp-fetch" href="ch02.html#callout-cpp-fetch">(5)</a>
+ std::cout << message.getContent() << std::endl;
+ session.acknowledge(); <a class="co" name="hello-cpp-acknowledge" href="ch02.html#callout-cpp-acknowledge">(6)</a>
+
+ connection.close(); <a class="co" name="hello-cpp-close" href="ch02.html#callout-cpp-close">(7)</a>
+ return 0;
+ } catch(const std::exception& error) {
+ std::cerr << error.what() << std::endl;
+ connection.close();
+ return 1;
+ }
+ }</pre><div class="calloutlist"><table border="0" summary="Callout list"><tr><td width="5%" valign="top" align="left"><p><a name="callout-cpp-open"></a><a href="#hello-cpp-open">(1)</a> </p></td><td valign="top" align="left"><p>Establishes the connection with the messaging broker.</p></td></tr><tr><td width="5%" valign="top" align="left"><p><a name="callout-cpp-session"></a><a href="#hello-cpp-session">(2)</a> </p></td><td valign="top" align="left"><p>Creates a session object on which messages will be sent and received.</p></td></tr><tr><td width="5%" valign="top" align="left"><p><a name="callout-cpp-receiver"></a><a href="#hello-cpp-receiver">(3)</a> </p></td><td valign="top" align="left"><p>Creates a receiver that receives messages from the given address.</p></td></tr><tr><td width="5%" valign="top" align="left"><p><a name="callout-cpp-sender"></a><a href="#hello-cpp-sender">(4)</a> </p></td><td valign="top" align="left"><p>Creates a sender that sends to the given address
.</p></td></tr><tr><td width="5%" valign="top" align="left"><p><a name="callout-cpp-fetch"></a><a href="#hello-cpp-fetch">(5)</a> </p></td><td valign="top" align="left"><p>Receives the next message. The duration is optional, if omitted, will wait indefinitely for the next message.</p></td></tr><tr><td width="5%" valign="top" align="left"><p><a name="callout-cpp-acknowledge"></a><a href="#hello-cpp-acknowledge">(6)</a> </p></td><td valign="top" align="left"><p>Acknowledges receipt of all fetched messages on the
+ session. This informs the broker that the messages were
+ transferred and processed by the client successfully.</p></td></tr><tr><td width="5%" valign="top" align="left"><p><a name="callout-cpp-close"></a><a href="#hello-cpp-close">(7)</a> </p></td><td valign="top" align="left"><p>Closes the connection, all sessions managed by the connection, and all senders and receivers managed by each session.</p></td></tr></table></div></div></div><br class="example-break"></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch01.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="ch02s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 1. Introduction </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 2.2. A Simple Messaging Program in Python</td></tr></table
></div><div class="main_text_area_bottom"></div></div></div></body></html>
Added: qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02s02.html
URL: http://svn.apache.org/viewvc/qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02s02.html?rev=1413422&view=auto
==============================================================================
--- qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02s02.html (added)
+++ qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02s02.html Sun Nov 25 21:12:24 2012
@@ -0,0 +1,31 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>2.2. A Simple Messaging Program in Python</title><link rel="stylesheet" href="css/style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" 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="ch02.html" title="Chapter 2. Using the Qpid Messaging API"><link rel="next" href="ch02s03.html" title="2.3. A Simple Messaging Program in .NET C#"></head><body><div class="container" bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><DIV class="header"><DIV class="logo"><H1>Apache Qpidâ¢</H1><H2>Open Source AMQP Messaging</H2></DIV></DIV><DIV class="menu_box"><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Apache Qpid</H3><UL><LI><A href="http://qpid.apache.org/index.html">Home</A></LI><
LI><A href="http://qpid.apache.org/download.html">Download</A></LI><LI><A href="http://qpid.apache.org/getting_started.html">Getting Started</A></LI><LI><A href="http://www.apache.org/licenses/">License</A></LI><LI><A href="https://cwiki.apache.org/qpid/faq.html">FAQ</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Documentation</H3><UL><LI><A href="http://qpid.apache.org/documentation.html#doc-release">Latest Release</A></LI><LI><A href="http://qpid.apache.org/documentation.html#doc-trunk">Trunk</A></LI><LI><A href="http://qpid.apache.org/documentation.html#doc-archives">Archive</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Community</H3><UL><LI><A href="http://qpid.apache.org/getting_involved.html">Getting Involved</A></LI><LI><A href="http://qpid.apache.org/source_repository.html">Source Repository</A></LI><LI><A href="http://qpid.apac
he.org/mailing_lists.html">Mailing Lists</A></LI><LI><A href="https://cwiki.apache.org/qpid/">Wiki</A></LI><LI><A href="https://issues.apache.org/jira/browse/qpid">Issue Reporting</A></LI><LI><A href="http://qpid.apache.org/people.html">People</A></LI><LI><A href="http://qpid.apache.org/acknowledgements.html">Acknowledgements</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Developers</H3><UL><LI><A href="https://cwiki.apache.org/qpid/building.html">Building Qpid</A></LI><LI><A href="https://cwiki.apache.org/qpid/developer-pages.html">Developer Pages</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>About AMQP</H3><UL><LI><A href="http://qpid.apache.org/amqp.html">What is AMQP?</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>About Apache</H3><UL><LI><A href="http://www.apach
e.org">Home</A></LI><LI><A href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</A></LI><LI><A href="http://www.apache.org/foundation/thanks.html">Thanks</A></LI><LI><A href="http://www.apache.org/security/">Security</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV></DIV><div class="main_text_area"><div class="main_text_area_top"></div><div class="main_text_area_body"><DIV class="breadcrumbs"><span class="breadcrumb-link"><a href="index.html">Programming in Apache Qpid</a></span> > <span class="breadcrumb-link"><a href="ch02.html">Using the Qpid Messaging API</a></span> > <span class="breadcrumb-node">A Simple Messaging Program in Python</span></DIV><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="id2514546"></a>2.2. A Simple Messaging Program in Python</h2></div></div></div><p>The following Python program shows how to create a
+ connection, create a session, send messages using a sender, and
+ receive messages using a receiver.</p><div class="example"><a name="id2541493"></a><p class="title"><b>Example 2.2. "Hello world!" in Python</b></p><div class="example-contents"><pre class="programlisting">
+ import sys
+ from qpid.messaging import *
+
+ broker = "localhost:5672" if len(sys.argv)<2 else sys.argv[1]
+ address = "amq.topic" if len(sys.argv)<3 else sys.argv[2]
+
+ connection = Connection(broker)
+
+ try:
+ connection.open() <a class="co" name="hello-python-open" href="ch02s02.html#callout-python-open">(1)</a>
+ session = connection.session() <a class="co" name="hello-python-session" href="ch02s02.html#callout-python-session">(2)</a>
+
+ sender = session.sender(address) <a class="co" name="hello-python-sender" href="ch02s02.html#callout-python-sender">(3)</a>
+ receiver = session.receiver(address) <a class="co" name="hello-python-receiver" href="ch02s02.html#callout-python-receiver">(4)</a>
+
+ sender.send(Message("Hello world!"));
+
+ message = receiver.fetch(timeout=1) <a class="co" name="hello-python-fetch" href="ch02s02.html#callout-python-fetch">(5)</a>
+ print message.content
+ session.acknowledge() <a class="co" name="hello-python-acknowledge" href="ch02s02.html#callout-python-acknowledge">(6)</a>
+
+ except MessagingError,m:
+ print m
+ finally:
+ connection.close() <a class="co" name="hello-python-close" href="ch02s02.html#callout-python-close">(7)</a>
+ </pre><div class="calloutlist"><table border="0" summary="Callout list"><tr><td width="5%" valign="top" align="left"><p><a name="callout-python-open"></a><a href="#hello-python-open">(1)</a> </p></td><td valign="top" align="left"><p>Establishes the connection with the messaging broker.</p></td></tr><tr><td width="5%" valign="top" align="left"><p><a name="callout-python-session"></a><a href="#hello-python-session">(2)</a> </p></td><td valign="top" align="left"><p>Creates a session object on which messages will be sent and received.</p></td></tr><tr><td width="5%" valign="top" align="left"><p><a name="callout-python-receiver"></a><a href="#hello-python-receiver">(4)</a> </p></td><td valign="top" align="left"><p>Creates a receiver that receives messages from the given address.</p></td></tr><tr><td width="5%" valign="top" align="left"><p><a name="callout-python-sender"></a><a href="#hello-python-sender">(3)</a> </p></td><td valign="top" align="left"><p>Creates a sender that sen
ds to the given address.</p></td></tr><tr><td width="5%" valign="top" align="left"><p><a name="callout-python-fetch"></a><a href="#hello-python-fetch">(5)</a> </p></td><td valign="top" align="left"><p>Receives the next message. The duration is optional, if omitted, will wait indefinitely for the next message.</p></td></tr><tr><td width="5%" valign="top" align="left"><p><a name="callout-python-acknowledge"></a><a href="#hello-python-acknowledge">(6)</a> </p></td><td valign="top" align="left"><p>Acknowledges receipt of all fetched messages on
+ the session. This informs the broker that the messages were
+ transfered and processed by the client successfully.</p></td></tr><tr><td width="5%" valign="top" align="left"><p><a name="callout-python-close"></a><a href="#hello-python-close">(7)</a> </p></td><td valign="top" align="left"><p>Closes the connection, all sessions managed by the connection, and all senders and receivers managed by each session.</p></td></tr></table></div></div></div><br class="example-break"></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02.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="ch02s03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 2. Using the Qpid Messaging API </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 2.3. A
Simple Messaging Program in .NET C#</td></tr></table></div><div class="main_text_area_bottom"></div></div></div></body></html>
Added: qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02s03.html
URL: http://svn.apache.org/viewvc/qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02s03.html?rev=1413422&view=auto
==============================================================================
--- qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02s03.html (added)
+++ qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02s03.html Sun Nov 25 21:12:24 2012
@@ -0,0 +1,48 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>2.3. A Simple Messaging Program in .NET C#</title><link rel="stylesheet" href="css/style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" 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="ch02s02.html" title="2.2. A Simple Messaging Program in Python"><link rel="next" href="section-addresses.html" title="2.4. Addresses"></head><body><div class="container" bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><DIV class="header"><DIV class="logo"><H1>Apache Qpidâ¢</H1><H2>Open Source AMQP Messaging</H2></DIV></DIV><DIV class="menu_box"><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Apache Qpid</H3><UL><LI><A href="http://qpid.apache.org/index.html">Home</A></LI><LI><A href="htt
p://qpid.apache.org/download.html">Download</A></LI><LI><A href="http://qpid.apache.org/getting_started.html">Getting Started</A></LI><LI><A href="http://www.apache.org/licenses/">License</A></LI><LI><A href="https://cwiki.apache.org/qpid/faq.html">FAQ</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Documentation</H3><UL><LI><A href="http://qpid.apache.org/documentation.html#doc-release">Latest Release</A></LI><LI><A href="http://qpid.apache.org/documentation.html#doc-trunk">Trunk</A></LI><LI><A href="http://qpid.apache.org/documentation.html#doc-archives">Archive</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Community</H3><UL><LI><A href="http://qpid.apache.org/getting_involved.html">Getting Involved</A></LI><LI><A href="http://qpid.apache.org/source_repository.html">Source Repository</A></LI><LI><A href="http://qpid.apache.org/mailing_
lists.html">Mailing Lists</A></LI><LI><A href="https://cwiki.apache.org/qpid/">Wiki</A></LI><LI><A href="https://issues.apache.org/jira/browse/qpid">Issue Reporting</A></LI><LI><A href="http://qpid.apache.org/people.html">People</A></LI><LI><A href="http://qpid.apache.org/acknowledgements.html">Acknowledgements</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Developers</H3><UL><LI><A href="https://cwiki.apache.org/qpid/building.html">Building Qpid</A></LI><LI><A href="https://cwiki.apache.org/qpid/developer-pages.html">Developer Pages</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>About AMQP</H3><UL><LI><A href="http://qpid.apache.org/amqp.html">What is AMQP?</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>About Apache</H3><UL><LI><A href="http://www.apache.org">Home</A>
</LI><LI><A href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</A></LI><LI><A href="http://www.apache.org/foundation/thanks.html">Thanks</A></LI><LI><A href="http://www.apache.org/security/">Security</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV></DIV><div class="main_text_area"><div class="main_text_area_top"></div><div class="main_text_area_body"><DIV class="breadcrumbs"><span class="breadcrumb-link"><a href="index.html">Programming in Apache Qpid</a></span> > <span class="breadcrumb-link"><a href="ch02.html">Using the Qpid Messaging API</a></span> > <span class="breadcrumb-node">A Simple Messaging Program in .NET C#</span></DIV><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="id2522382"></a>2.3. A Simple Messaging Program in .NET C#</h2></div></div></div><p>The following .NET C#
+ <sup>[<a name="id2543950" href="#ftn.id2543950" class="footnote">1</a>]</sup>
+ program shows how to create a connection,
+ create a session, send messages using a sender, and receive
+ messages using a receiver.
+ </p><div class="example"><a name="id2528473"></a><p class="title"><b>Example 2.3. "Hello world!" in .NET C#</b></p><div class="example-contents"><pre class="programlisting">
+ using System;
+ using Org.Apache.Qpid.Messaging; <a class="co" name="hello-csharp-using" href="ch02s03.html#callout-csharp-using">(1)</a>
+
+ namespace Org.Apache.Qpid.Messaging {
+ class Program {
+ static void Main(string[] args) {
+ String broker = args.Length > 0 ? args[0] : "localhost:5672";
+ String address = args.Length > 1 ? args[1] : "amq.topic";
+
+ Connection connection = null;
+ try {
+ connection = new Connection(broker);
+ connection.Open(); <a class="co" name="hello-csharp-open" href="ch02s03.html#callout-csharp-open">(2)</a>
+ Session session = connection.CreateSession(); <a class="co" name="hello-csharp-session" href="ch02s03.html#callout-csharp-session">(3)</a>
+
+ Receiver receiver = session.CreateReceiver(address); <a class="co" name="hello-csharp-receiver" href="ch02s03.html#callout-csharp-receiver">(4)</a>
+ Sender sender = session.CreateSender(address); <a class="co" name="hello-csharp-sender" href="ch02s03.html#callout-csharp-sender">(5)</a>
+
+ sender.Send(new Message("Hello world!"));
+
+ Message message = new Message();
+ message = receiver.Fetch(DurationConstants.SECOND * 1); <a class="co" name="hello-csharp-fetch" href="ch02s03.html#callout-csharp-fetch">(6)</a>
+ Console.WriteLine("{0}", message.GetContent());
+ session.Acknowledge(); <a class="co" name="hello-csharp-acknowledge" href="ch02s03.html#callout-csharp-acknowledge">(7)</a>
+
+ connection.Close(); <a class="co" name="hello-csharp-close" href="ch02s03.html#callout-csharp-close">(8)</a>
+ } catch (Exception e) {
+ Console.WriteLine("Exception {0}.", e);
+ if (null != connection)
+ connection.Close();
+ }
+ }
+ }
+ }
+
+ </pre><div class="calloutlist"><table border="0" summary="Callout list"><tr><td width="5%" valign="top" align="left"><p><a name="callout-csharp-using"></a><a href="#hello-csharp-using">(1)</a> </p></td><td valign="top" align="left"><p> Permits use of Org.Apache.Qpid.Messaging types and methods without explicit namespace qualification. Any .NET project must have a project reference to the assembly file <code class="literal">Org.Apache.Qpid.Messaging.dll</code> in order to obtain the definitions of the .NET Binding for Qpid Messaging namespace.</p></td></tr><tr><td width="5%" valign="top" align="left"><p><a name="callout-csharp-open"></a><a href="#hello-csharp-open">(2)</a> </p></td><td valign="top" align="left"><p>Establishes the connection with the messaging broker.</p></td></tr><tr><td width="5%" valign="top" align="left"><p><a name="callout-csharp-session"></a><a href="#hello-csharp-session">(3)</a> </p></td><td valign="top" align="left"><p>Creates a session object on whi
ch messages will be sent and received.</p></td></tr><tr><td width="5%" valign="top" align="left"><p><a name="callout-csharp-receiver"></a><a href="#hello-csharp-receiver">(4)</a> </p></td><td valign="top" align="left"><p>Creates a receiver that receives messages from the given address.</p></td></tr><tr><td width="5%" valign="top" align="left"><p><a name="callout-csharp-sender"></a><a href="#hello-csharp-sender">(5)</a> </p></td><td valign="top" align="left"><p>Creates a sender that sends to the given address.</p></td></tr><tr><td width="5%" valign="top" align="left"><p><a name="callout-csharp-fetch"></a><a href="#hello-csharp-fetch">(6)</a> </p></td><td valign="top" align="left"><p>Receives the next message. The duration is optional, if omitted, will wait indefinitely for the next message.</p></td></tr><tr><td width="5%" valign="top" align="left"><p><a name="callout-csharp-acknowledge"></a><a href="#hello-csharp-acknowledge">(7)</a> </p></td><td valign="top" align="left"><p>
Acknowledges receipt of all fetched messages on the
+ session. This informs the broker that the messages were
+ transfered and processed by the client successfully.</p></td></tr><tr><td width="5%" valign="top" align="left"><p><a name="callout-csharp-close"></a><a href="#hello-csharp-close">(8)</a> </p></td><td valign="top" align="left"><p>Closes the connection, all sessions managed by the connection, and all senders and receivers managed by each session.</p></td></tr></table></div></div></div><br class="example-break"><div class="footnotes"><br><hr width="100" align="left"><div class="footnote"><p><sup>[<a name="ftn.id2543950" href="#id2543950" class="para">1</a>] </sup>
+ The .NET binding for the Qpid C++ Messaging API
+ applies to all .NET Framework managed code languages. C# was chosen
+ for illustration purposes only.
+ </p></div></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s02.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="section-addresses.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">2.2. A Simple Messaging Program in Python </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 2.4. Addresses</td></tr></table></div><div class="main_text_area_bottom"></div></div></div></body></html>
Added: qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02s08.html
URL: http://svn.apache.org/viewvc/qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02s08.html?rev=1413422&view=auto
==============================================================================
--- qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02s08.html (added)
+++ qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02s08.html Sun Nov 25 21:12:24 2012
@@ -0,0 +1,37 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>2.8. Receiving Messages from Multiple Sources</title><link rel="stylesheet" href="css/style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" 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="acknowledgements.html" title="2.7. Acknowledging Received Messages"><link rel="next" href="ch02s09.html" title="2.9. Transactions"></head><body><div class="container" bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><DIV class="header"><DIV class="logo"><H1>Apache Qpidâ¢</H1><H2>Open Source AMQP Messaging</H2></DIV></DIV><DIV class="menu_box"><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Apache Qpid</H3><UL><LI><A href="http://qpid.apache.org/index.html">Home</A></LI><LI><A href="htt
p://qpid.apache.org/download.html">Download</A></LI><LI><A href="http://qpid.apache.org/getting_started.html">Getting Started</A></LI><LI><A href="http://www.apache.org/licenses/">License</A></LI><LI><A href="https://cwiki.apache.org/qpid/faq.html">FAQ</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Documentation</H3><UL><LI><A href="http://qpid.apache.org/documentation.html#doc-release">Latest Release</A></LI><LI><A href="http://qpid.apache.org/documentation.html#doc-trunk">Trunk</A></LI><LI><A href="http://qpid.apache.org/documentation.html#doc-archives">Archive</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Community</H3><UL><LI><A href="http://qpid.apache.org/getting_involved.html">Getting Involved</A></LI><LI><A href="http://qpid.apache.org/source_repository.html">Source Repository</A></LI><LI><A href="http://qpid.apache.org/mailing_
lists.html">Mailing Lists</A></LI><LI><A href="https://cwiki.apache.org/qpid/">Wiki</A></LI><LI><A href="https://issues.apache.org/jira/browse/qpid">Issue Reporting</A></LI><LI><A href="http://qpid.apache.org/people.html">People</A></LI><LI><A href="http://qpid.apache.org/acknowledgements.html">Acknowledgements</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Developers</H3><UL><LI><A href="https://cwiki.apache.org/qpid/building.html">Building Qpid</A></LI><LI><A href="https://cwiki.apache.org/qpid/developer-pages.html">Developer Pages</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>About AMQP</H3><UL><LI><A href="http://qpid.apache.org/amqp.html">What is AMQP?</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>About Apache</H3><UL><LI><A href="http://www.apache.org">Home</A>
</LI><LI><A href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</A></LI><LI><A href="http://www.apache.org/foundation/thanks.html">Thanks</A></LI><LI><A href="http://www.apache.org/security/">Security</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV></DIV><div class="main_text_area"><div class="main_text_area_top"></div><div class="main_text_area_body"><DIV class="breadcrumbs"><span class="breadcrumb-link"><a href="index.html">Programming in Apache Qpid</a></span> > <span class="breadcrumb-link"><a href="ch02.html">Using the Qpid Messaging API</a></span> > <span class="breadcrumb-node">Receiving Messages from Multiple Sources</span></DIV><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="id2509154"></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">next receiver</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="prefetch.html" title="2.6. Receiver Capacity (Prefetch)">Section 2.6, âReceiver Capacity (Prefetch)â</a> for more on this.</p><div class="example"><a name="id2509186"></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><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="acknowledgements.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><div class="main_text_area_bottom"></div></div></div></body></html>
Added: qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02s09.html
URL: http://svn.apache.org/viewvc/qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02s09.html?rev=1413422&view=auto
==============================================================================
--- qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02s09.html (added)
+++ qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02s09.html Sun Nov 25 21:12:24 2012
@@ -0,0 +1,33 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>2.9. Transactions</title><link rel="stylesheet" href="css/style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" 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="connection-options.html" title="2.10. Connection Options"></head><body><div class="container" bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><DIV class="header"><DIV class="logo"><H1>Apache Qpidâ¢</H1><H2>Open Source AMQP Messaging</H2></DIV></DIV><DIV class="menu_box"><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Apache Qpid</H3><UL><LI><A href="http://qpid.apache.org/index.html">Home</A></LI><LI><A href="http://qpid.a
pache.org/download.html">Download</A></LI><LI><A href="http://qpid.apache.org/getting_started.html">Getting Started</A></LI><LI><A href="http://www.apache.org/licenses/">License</A></LI><LI><A href="https://cwiki.apache.org/qpid/faq.html">FAQ</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Documentation</H3><UL><LI><A href="http://qpid.apache.org/documentation.html#doc-release">Latest Release</A></LI><LI><A href="http://qpid.apache.org/documentation.html#doc-trunk">Trunk</A></LI><LI><A href="http://qpid.apache.org/documentation.html#doc-archives">Archive</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Community</H3><UL><LI><A href="http://qpid.apache.org/getting_involved.html">Getting Involved</A></LI><LI><A href="http://qpid.apache.org/source_repository.html">Source Repository</A></LI><LI><A href="http://qpid.apache.org/mailing_lists.html
">Mailing Lists</A></LI><LI><A href="https://cwiki.apache.org/qpid/">Wiki</A></LI><LI><A href="https://issues.apache.org/jira/browse/qpid">Issue Reporting</A></LI><LI><A href="http://qpid.apache.org/people.html">People</A></LI><LI><A href="http://qpid.apache.org/acknowledgements.html">Acknowledgements</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Developers</H3><UL><LI><A href="https://cwiki.apache.org/qpid/building.html">Building Qpid</A></LI><LI><A href="https://cwiki.apache.org/qpid/developer-pages.html">Developer Pages</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>About AMQP</H3><UL><LI><A href="http://qpid.apache.org/amqp.html">What is AMQP?</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>About Apache</H3><UL><LI><A href="http://www.apache.org">Home</A></LI><LI><
A href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</A></LI><LI><A href="http://www.apache.org/foundation/thanks.html">Thanks</A></LI><LI><A href="http://www.apache.org/security/">Security</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV></DIV><div class="main_text_area"><div class="main_text_area_top"></div><div class="main_text_area_body"><DIV class="breadcrumbs"><span class="breadcrumb-link"><a href="index.html">Programming in Apache Qpid</a></span> > <span class="breadcrumb-link"><a href="ch02.html">Using the Qpid Messaging API</a></span> > <span class="breadcrumb-node">Transactions</span></DIV><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="id2509239"></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="id2509266" href="#ftn.id2509266" class="footnote">8</a>]</sup>
+
+ .</p><div class="example"><a name="id2509276"></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.id2509266" href="#id2509266" 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><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="connection-options.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><div class="main_text_area_bottom"></div></div></div></body></html>
Added: qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02s12.html
URL: http://svn.apache.org/viewvc/qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02s12.html?rev=1413422&view=auto
==============================================================================
--- qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02s12.html (added)
+++ qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02s12.html Sun Nov 25 21:12:24 2012
@@ -0,0 +1,42 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>2.12. The Request / Response Pattern</title><link rel="stylesheet" href="css/style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" 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="section-Maps.html" title="2.11. Maps and Lists in Message Content"><link rel="next" href="ch02s13.html" title="2.13. Performance Tips"></head><body><div class="container" bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><DIV class="header"><DIV class="logo"><H1>Apache Qpidâ¢</H1><H2>Open Source AMQP Messaging</H2></DIV></DIV><DIV class="menu_box"><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Apache Qpid</H3><UL><LI><A href="http://qpid.apache.org/index.html">Home</A></LI><LI><A href="http://q
pid.apache.org/download.html">Download</A></LI><LI><A href="http://qpid.apache.org/getting_started.html">Getting Started</A></LI><LI><A href="http://www.apache.org/licenses/">License</A></LI><LI><A href="https://cwiki.apache.org/qpid/faq.html">FAQ</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Documentation</H3><UL><LI><A href="http://qpid.apache.org/documentation.html#doc-release">Latest Release</A></LI><LI><A href="http://qpid.apache.org/documentation.html#doc-trunk">Trunk</A></LI><LI><A href="http://qpid.apache.org/documentation.html#doc-archives">Archive</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Community</H3><UL><LI><A href="http://qpid.apache.org/getting_involved.html">Getting Involved</A></LI><LI><A href="http://qpid.apache.org/source_repository.html">Source Repository</A></LI><LI><A href="http://qpid.apache.org/mailing_lists
.html">Mailing Lists</A></LI><LI><A href="https://cwiki.apache.org/qpid/">Wiki</A></LI><LI><A href="https://issues.apache.org/jira/browse/qpid">Issue Reporting</A></LI><LI><A href="http://qpid.apache.org/people.html">People</A></LI><LI><A href="http://qpid.apache.org/acknowledgements.html">Acknowledgements</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Developers</H3><UL><LI><A href="https://cwiki.apache.org/qpid/building.html">Building Qpid</A></LI><LI><A href="https://cwiki.apache.org/qpid/developer-pages.html">Developer Pages</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>About AMQP</H3><UL><LI><A href="http://qpid.apache.org/amqp.html">What is AMQP?</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>About Apache</H3><UL><LI><A href="http://www.apache.org">Home</A></LI>
<LI><A href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</A></LI><LI><A href="http://www.apache.org/foundation/thanks.html">Thanks</A></LI><LI><A href="http://www.apache.org/security/">Security</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV></DIV><div class="main_text_area"><div class="main_text_area_top"></div><div class="main_text_area_body"><DIV class="breadcrumbs"><span class="breadcrumb-link"><a href="index.html">Programming in Apache Qpid</a></span> > <span class="breadcrumb-link"><a href="ch02.html">Using the Qpid Messaging API</a></span> > <span class="breadcrumb-node">The Request / Response Pattern</span></DIV><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="id2552360"></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="section-amqp0-10-mapping.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="id2552384"></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><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="section-Maps.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><div class="main_text_area_bottom"></div></div></div></body></html>
Added: qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02s13.html
URL: http://svn.apache.org/viewvc/qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02s13.html?rev=1413422&view=auto
==============================================================================
--- qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02s13.html (added)
+++ qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02s13.html Sun Nov 25 21:12:24 2012
@@ -0,0 +1,22 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>2.13. Performance Tips</title><link rel="stylesheet" href="css/style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" 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><div class="container" bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><DIV class="header"><DIV class="logo"><H1>Apache Qpidâ¢</H1><H2>Open Source AMQP Messaging</H2></DIV></DIV><DIV class="menu_box"><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Apache Qpid</H3><UL><LI><A href="http://qpid.apache.org/index.html">Home</A></LI><LI><A href="http://qpid.apache.org/downloa
d.html">Download</A></LI><LI><A href="http://qpid.apache.org/getting_started.html">Getting Started</A></LI><LI><A href="http://www.apache.org/licenses/">License</A></LI><LI><A href="https://cwiki.apache.org/qpid/faq.html">FAQ</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Documentation</H3><UL><LI><A href="http://qpid.apache.org/documentation.html#doc-release">Latest Release</A></LI><LI><A href="http://qpid.apache.org/documentation.html#doc-trunk">Trunk</A></LI><LI><A href="http://qpid.apache.org/documentation.html#doc-archives">Archive</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Community</H3><UL><LI><A href="http://qpid.apache.org/getting_involved.html">Getting Involved</A></LI><LI><A href="http://qpid.apache.org/source_repository.html">Source Repository</A></LI><LI><A href="http://qpid.apache.org/mailing_lists.html">Mailing Lists</
A></LI><LI><A href="https://cwiki.apache.org/qpid/">Wiki</A></LI><LI><A href="https://issues.apache.org/jira/browse/qpid">Issue Reporting</A></LI><LI><A href="http://qpid.apache.org/people.html">People</A></LI><LI><A href="http://qpid.apache.org/acknowledgements.html">Acknowledgements</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Developers</H3><UL><LI><A href="https://cwiki.apache.org/qpid/building.html">Building Qpid</A></LI><LI><A href="https://cwiki.apache.org/qpid/developer-pages.html">Developer Pages</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>About AMQP</H3><UL><LI><A href="http://qpid.apache.org/amqp.html">What is AMQP?</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>About Apache</H3><UL><LI><A href="http://www.apache.org">Home</A></LI><LI><A href="http://ww
w.apache.org/foundation/sponsorship.html">Sponsorship</A></LI><LI><A href="http://www.apache.org/foundation/thanks.html">Thanks</A></LI><LI><A href="http://www.apache.org/security/">Security</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV></DIV><div class="main_text_area"><div class="main_text_area_top"></div><div class="main_text_area_body"><DIV class="breadcrumbs"><span class="breadcrumb-link"><a href="index.html">Programming in Apache Qpid</a></span> > <span class="breadcrumb-link"><a href="ch02.html">Using the Qpid Messaging API</a></span> > <span class="breadcrumb-node">Performance Tips</span></DIV><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="id2552471"></a>2.13. Performance Tips</h2></div></div></div><div class="itemizedlist"><ul><li><p>Consider prefetching messages for receivers (see
+ <a class="xref" href="prefetch.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><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><p>Acknowledge messages in batches (see
+ <a class="xref" href="acknowledgements.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><p>Tune the sender capacity (see
+ <a class="xref" href="replay.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><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><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><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><div class="main_text_area_bottom"></div></div></div></body></html>
Added: qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02s14.html
URL: http://svn.apache.org/viewvc/qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02s14.html?rev=1413422&view=auto
==============================================================================
--- qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02s14.html (added)
+++ qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02s14.html Sun Nov 25 21:12:24 2012
@@ -0,0 +1,34 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>2.14. Cluster Failover</title><link rel="stylesheet" href="css/style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" 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><div class="container" bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><DIV class="header"><DIV class="logo"><H1>Apache Qpidâ¢</H1><H2>Open Source AMQP Messaging</H2></DIV></DIV><DIV class="menu_box"><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Apache Qpid</H3><UL><LI><A href="http://qpid.apache.org/index.html">Home</A></LI><LI><A href="http://qpid.apache.org/download.html">Download</A></L
I><LI><A href="http://qpid.apache.org/getting_started.html">Getting Started</A></LI><LI><A href="http://www.apache.org/licenses/">License</A></LI><LI><A href="https://cwiki.apache.org/qpid/faq.html">FAQ</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Documentation</H3><UL><LI><A href="http://qpid.apache.org/documentation.html#doc-release">Latest Release</A></LI><LI><A href="http://qpid.apache.org/documentation.html#doc-trunk">Trunk</A></LI><LI><A href="http://qpid.apache.org/documentation.html#doc-archives">Archive</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Community</H3><UL><LI><A href="http://qpid.apache.org/getting_involved.html">Getting Involved</A></LI><LI><A href="http://qpid.apache.org/source_repository.html">Source Repository</A></LI><LI><A href="http://qpid.apache.org/mailing_lists.html">Mailing Lists</A></LI><LI><A href="htt
ps://cwiki.apache.org/qpid/">Wiki</A></LI><LI><A href="https://issues.apache.org/jira/browse/qpid">Issue Reporting</A></LI><LI><A href="http://qpid.apache.org/people.html">People</A></LI><LI><A href="http://qpid.apache.org/acknowledgements.html">Acknowledgements</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Developers</H3><UL><LI><A href="https://cwiki.apache.org/qpid/building.html">Building Qpid</A></LI><LI><A href="https://cwiki.apache.org/qpid/developer-pages.html">Developer Pages</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>About AMQP</H3><UL><LI><A href="http://qpid.apache.org/amqp.html">What is AMQP?</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>About Apache</H3><UL><LI><A href="http://www.apache.org">Home</A></LI><LI><A href="http://www.apache.org/foundation
/sponsorship.html">Sponsorship</A></LI><LI><A href="http://www.apache.org/foundation/thanks.html">Thanks</A></LI><LI><A href="http://www.apache.org/security/">Security</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV></DIV><div class="main_text_area"><div class="main_text_area_top"></div><div class="main_text_area_body"><DIV class="breadcrumbs"><span class="breadcrumb-link"><a href="index.html">Programming in Apache Qpid</a></span> > <span class="breadcrumb-link"><a href="ch02.html">Using the Qpid Messaging API</a></span> > <span class="breadcrumb-node">Cluster Failover</span></DIV><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="id2552556"></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 con
tinue their work. Each broker in the cluster also advertises the addresses of all known brokers
+
+ <sup>[<a name="id2552569" href="#ftn.id2552569" 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="id2552585"></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.id2552569" href="#id2552569" class="para">11</a>] </sup>This is done via the amq.failover exchange in AMQP 0-10</p></div></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><div class="main_text_area_bottom"></div></div></div></body></html>
Added: qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02s15.html
URL: http://svn.apache.org/viewvc/qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02s15.html?rev=1413422&view=auto
==============================================================================
--- qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02s15.html (added)
+++ qpid/site/docs/books/0.20/Programming-In-Apache-Qpid/html/ch02s15.html Sun Nov 25 21:12:24 2012
@@ -0,0 +1,26 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>2.15. Logging</title><link rel="stylesheet" href="css/style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" 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="section-amqp0-10-mapping.html" title="2.16. The AMQP 0-10 mapping"></head><body><div class="container" bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><DIV class="header"><DIV class="logo"><H1>Apache Qpidâ¢</H1><H2>Open Source AMQP Messaging</H2></DIV></DIV><DIV class="menu_box"><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Apache Qpid</H3><UL><LI><A href="http://qpid.apache.org/index.html">Home</A></LI><LI><A href="http://qpid.apache.org/download
.html">Download</A></LI><LI><A href="http://qpid.apache.org/getting_started.html">Getting Started</A></LI><LI><A href="http://www.apache.org/licenses/">License</A></LI><LI><A href="https://cwiki.apache.org/qpid/faq.html">FAQ</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Documentation</H3><UL><LI><A href="http://qpid.apache.org/documentation.html#doc-release">Latest Release</A></LI><LI><A href="http://qpid.apache.org/documentation.html#doc-trunk">Trunk</A></LI><LI><A href="http://qpid.apache.org/documentation.html#doc-archives">Archive</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Community</H3><UL><LI><A href="http://qpid.apache.org/getting_involved.html">Getting Involved</A></LI><LI><A href="http://qpid.apache.org/source_repository.html">Source Repository</A></LI><LI><A href="http://qpid.apache.org/mailing_lists.html">Mailing Lists</A
></LI><LI><A href="https://cwiki.apache.org/qpid/">Wiki</A></LI><LI><A href="https://issues.apache.org/jira/browse/qpid">Issue Reporting</A></LI><LI><A href="http://qpid.apache.org/people.html">People</A></LI><LI><A href="http://qpid.apache.org/acknowledgements.html">Acknowledgements</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Developers</H3><UL><LI><A href="https://cwiki.apache.org/qpid/building.html">Building Qpid</A></LI><LI><A href="https://cwiki.apache.org/qpid/developer-pages.html">Developer Pages</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>About AMQP</H3><UL><LI><A href="http://qpid.apache.org/amqp.html">What is AMQP?</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>About Apache</H3><UL><LI><A href="http://www.apache.org">Home</A></LI><LI><A href="http://www
.apache.org/foundation/sponsorship.html">Sponsorship</A></LI><LI><A href="http://www.apache.org/foundation/thanks.html">Thanks</A></LI><LI><A href="http://www.apache.org/security/">Security</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV></DIV><div class="main_text_area"><div class="main_text_area_top"></div><div class="main_text_area_body"><DIV class="breadcrumbs"><span class="breadcrumb-link"><a href="index.html">Programming in Apache Qpid</a></span> > <span class="breadcrumb-link"><a href="ch02.html">Using the Qpid Messaging API</a></span> > <span class="breadcrumb-node">Logging</span></DIV><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="id2552642"></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" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2552652"></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" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2552701"></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><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="section-amqp0-10-mapping.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><div class="main_text_area_bottom"></div></div></div></body></html>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org