qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r1368244 [10/14] - in /qpid/site/docs/books/trunk: AMQP-Messaging-Broker-CPP-Book/html/ AMQP-Messaging-Broker-CPP-Book/html/css/ AMQP-Messaging-Broker-CPP-Book/pdf/ AMQP-Messaging-Broker-Java-Book/html/ AMQP-Messaging-Broker-Java-Book/html/...
Date Wed, 01 Aug 2012 20:54:49 GMT
Added: qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/QpidJNDI.html
URL: http://svn.apache.org/viewvc/qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/QpidJNDI.html?rev=1368244&view=auto
==============================================================================
--- qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/QpidJNDI.html (added)
+++ qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/QpidJNDI.html Wed Aug  1 20:54:46 2012
@@ -0,0 +1,256 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>3.2. Apache Qpid JNDI Properties for AMQP Messaging</title><link rel="stylesheet" type="text/css" href="css/style.css"><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="Programming in Apache Qpid"><link rel="up" href="QpidJMS.html" title="Chapter 3. Using the Qpid JMS client"><link rel="prev" href="QpidJMS.html" title="Chapter 3. Using the Qpid JMS client"><link rel="next" href="ch03s03.html" title="3.3. Java JMS Message Properties"></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><L
 I><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">0.14 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.o
 rg">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> &gt; <span class="breadcrumb-link"><a href="QpidJMS.html">Using the Qpid JMS client</a></span> &gt; <span class="breadcrumb-node">Apache Qpid JNDI Properties for AMQP Messaging</span></DIV><div class="section" title="3.2. Apache Qpid JNDI Properties for AMQP Messaging"><div class="titlepage"><div><div><h2 class="title"><a name="QpidJNDI"></a>3.2. Apache Qpid JNDI Properties for AMQP Messaging</h2></div></div></div><p>
+	Apache Qpid defines JNDI properties that can be used to specify JMS Connections and Destinations. Here is a typical JNDI properties file:
+      </p><div class="example"><a name="id598268"></a><p class="title"><b>Example 3.3. JNDI Properties File</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'
+	# destination.[jndiname] = [address_string]
+	destination.topicExchange = amq.topic
+	</pre></div></div><br class="example-break"><p>The following sections describe the JNDI properties that Qpid uses.</p><div class="section" title="3.2.1. JNDI Properties for Apache Qpid"><div class="titlepage"><div><div><h3 class="title"><a name="id598287"></a>3.2.1. JNDI Properties for Apache Qpid</h3></div></div></div><p>
+	  Apache Qpid supports the properties shown in the following table:
+        </p><div class="table"><a name="id598296"></a><p class="title"><b>Table 3.1. JNDI Properties supported by Apache Qpid</b></p><div class="table-contents"><table summary="JNDI Properties supported by Apache Qpid" border="1"><colgroup><col><col></colgroup><thead><tr><th>
+		  Property
+	        </th><th>
+		  Purpose
+	        </th></tr></thead><tbody><tr><td>
+		  connectionfactory.&lt;jndiname&gt;
+	        </td><td>
+		  <p>
+		    The Connection URL that the connection factory uses to perform connections.
+		  </p>
+	        </td></tr><tr><td>
+		  queue.&lt;jndiname&gt;
+	        </td><td>
+		  <p>
+		    A JMS queue, which is implemented as an amq.direct exchange in Apache Qpid.
+		  </p>
+	        </td></tr><tr><td>
+		  topic.&lt;jndiname&gt;
+	        </td><td>
+		  <p>
+		    A JMS topic, which is implemented as an amq.topic exchange in Apache Qpid.
+		  </p>
+	        </td></tr><tr><td>
+		  destination.&lt;jndiname&gt;
+	        </td><td>
+		  <p>
+		    Can be used for defining all amq destinations,
+		    queues, topics and header matching, using an
+		    address string.
+
+		    <sup>[<a name="id598373" href="#ftn.id598373" class="footnote">a</a>]</sup>
+		  </p>
+	        </td></tr></tbody><tbody class="footnotes"><tr><td colspan="2"><div class="footnote"><p><sup>[<a id="ftn.id598373" href="#id598373" class="para">a</a>] </sup>Binding URLs, which were used in
+		    earlier versions of the Qpid Java JMS client, can
+		    still be used instead of address
+		    strings.</p></div></td></tr></tbody></table></div></div><br class="table-break"></div><div class="section" title="3.2.2. Connection URLs"><div class="titlepage"><div><div><h3 class="title"><a name="section-jms-connection-url"></a>3.2.2. Connection URLs</h3></div></div></div><p>
+	  In JNDI properties, a Connection URL specifies properties for a connection. The format for a Connection URL is:
+        </p><pre class="programlisting">amqp://[&lt;user&gt;:&lt;pass&gt;@][&lt;clientid&gt;]&lt;virtualhost&gt;[?&lt;option&gt;='&lt;value&gt;'[&amp;&lt;option&gt;='&lt;value&gt;']]
+        </pre><p>
+	  For instance, the following Connection URL specifies a user name, a password, a client ID, a virtual host ("test"), a broker list with a single broker, and a TCP host with the host name <span class="quote">“<span class="quote">localhost</span>”</span> using port 5672:
+        </p><pre class="programlisting">amqp://username:password@clientid/test?brokerlist='tcp://localhost:5672'
+        </pre><p>
+	  Apache Qpid supports the following properties in Connection URLs:
+        </p><div class="table"><a name="id598424"></a><p class="title"><b>Table 3.2. Connection URL Properties</b></p><div class="table-contents"><table summary="Connection URL Properties" width="100%" border="1"><colgroup><col><col><col></colgroup><thead><tr><th>
+		  Option
+	        </th><th>
+		  Type
+	        </th><th>
+		  Description
+	        </th></tr></thead><tbody><tr><td>
+		  brokerlist
+	        </td><td>
+		  see below
+	        </td><td>
+		  List of one or more broker addresses.
+	        </td></tr><tr><td>
+		  maxprefetch
+	        </td><td>
+		  integer
+	        </td><td>
+		  <p>
+                    The maximum number of pre-fetched messages per consumer. If not specified, default value of 500 is used.
+		  </p>
+		  <p>
+                    Note: You can also set the default per-consumer prefetch value on a client-wide basis by configuring the client using <a class="link" href="ch03s06.html#client-jvm-properties" title="3.6.1. Qpid JVM Arguments">Java system properties.</a>
+		  </p>
+	        </td></tr><tr><td>
+		  sync_publish
+	        </td><td>
+		  {'persistent' | 'all'}
+	        </td><td>
+		  A sync command is sent after every persistent message to guarantee that it has been received; if the value is 'persistent', this is done only for persistent messages.
+	        </td></tr><tr><td>
+		  sync_ack
+	        </td><td>
+		  Boolean
+	        </td><td>
+		  A sync command is sent after every acknowledgement to guarantee that it has been received.
+	        </td></tr><tr><td>
+		  use_legacy_map_msg_format
+	        </td><td>
+		  Boolean
+	        </td><td>
+		  If you are using JMS Map messages and deploying a new client with any JMS client older than 0.8 release, you must set this to true to ensure the older clients can understand the map message encoding.
+	        </td></tr><tr><td>
+		  failover
+	        </td><td>
+		  {'singlebroker' | 'roundrobin' | 'failover_exchange' | 'nofailover' | '&lt;class&gt;'}
+	        </td><td>
+		  <p>
+		    This option controls failover behaviour.  The method <code class="literal">singlebroker</code> uses only the first broker in the list,
+		    <code class="literal">roundrobin</code> will try each broker given in the broker list until a connection is established,
+		    <code class="literal">failover_exchange</code> connects to the initial broker given in the broker URL and will receive membership updates
+		    via the failover exchange. <code class="literal">nofailover</code> disables all retry and failover logic.  Any other value is interpreted as a
+		    classname which must implement the <code class="literal">org.apache.qpid.jms.failover.FailoverMethod</code> interface.
+		  </p>
+		  <p>
+		    The broker list options <code class="literal">retries</code> and <code class="literal">connectdelay</code> (described below) determine the number of times a
+		    connection to a broker will be retried and the the length of time to wait between successive connection attempts before moving on to
+		    the next broker in the list. The failover option <code class="literal">cyclecount</code> controls the number of times to loop through the list of
+		    available brokers before finally giving up.
+		  </p>
+		  <p>
+		    Defaults to <code class="literal">roundrobin</code> if the brokerlist contains multiple brokers, or <code class="literal">singlebroker</code> otherwise.
+		  </p>
+	        </td></tr></tbody></table></div></div><br class="table-break"><p>
+	  Broker lists are specified using a URL in this format:
+        </p><pre class="programlisting">brokerlist=&lt;transport&gt;://&lt;host&gt;[:&lt;port&gt;](?&lt;param&gt;='&lt;value&gt;')(&amp;&lt;param&gt;='&lt;value&gt;')*</pre><p>
+	  For instance, this is a typical broker list:
+        </p><pre class="programlisting">brokerlist='tcp://localhost:5672'
+        </pre><p>
+	  A broker list can contain more than one broker address; if so, the connection is made to the first broker in the list that is available. In general, it is better to use the failover exchange when using multiple brokers, since it allows applications to fail over if a broker goes down.
+	</p><div class="example"><a name="id598648"></a><p class="title"><b>Example 3.4. Broker Lists</b></p><div class="example-contents"><p>A broker list can specify properties to be used when connecting to the broker, such as security options. This broker list specifies options for a Kerberos connection using GSSAPI:</p><pre class="programlisting">
+	  amqp://guest:guest@test/test?sync_ack='true'
+	  &amp;brokerlist='tcp://ip1:5672?sasl_mechs='GSSAPI''
+	  </pre><p>This broker list specifies SSL options:</p><pre class="programlisting">
+	  amqp://guest:guest@test/test?sync_ack='true'
+	  &amp;brokerlist='tcp://ip1:5672?ssl='true'&amp;ssl_cert_alias='cert1''
+	  </pre><p>
+	    This broker list specifies two brokers using the connectdelay and retries broker options. It also illustrates the failover connection URL
+	    property.
+	  </p><pre class="programlisting">
+
+	  amqp://guest:guest@/test?failover='roundrobin?cyclecount='2''
+	  &amp;brokerlist='tcp://ip1:5672?retries='5'&amp;connectdelay='2000';tcp://ip2:5672?retries='5'&amp;connectdelay='2000''
+	  </pre></div></div><br class="example-break"><p>The following broker list options are supported.</p><div class="table"><a name="id598692"></a><p class="title"><b>Table 3.3. Broker List Options</b></p><div class="table-contents"><table summary="Broker List Options" width="100%" border="1"><colgroup><col><col><col></colgroup><thead><tr><th>
+		  Option
+	        </th><th>
+		  Type
+	        </th><th>
+		  Description
+	        </th></tr></thead><tbody><tr><td>
+		  heartbeat
+	        </td><td>
+		  integer
+	        </td><td>
+		  frequency of heartbeat messages (in seconds)
+	        </td></tr><tr><td>
+		  sasl_mechs
+	        </td><td>
+		  --
+	        </td><td>
+		  For secure applications, we suggest CRAM-MD5,
+		  DIGEST-MD5, or GSSAPI. The ANONYMOUS method is not
+		  secure. The PLAIN method is secure only when used
+		  together with SSL. For Kerberos, sasl_mechs must be
+		  set to GSSAPI, sasl_protocol must be set to the
+		  principal for the qpidd broker, e.g. qpidd/, and
+		  sasl_server must be set to the host for the SASL
+		  server, e.g. sasl.com.  SASL External is supported
+		  using SSL certification, e.g.
+		  <code class="literal">ssl='true'&amp;sasl_mechs='EXTERNAL'</code>
+	        </td></tr><tr><td>
+		  sasl_encryption
+	        </td><td>
+		  Boolean
+	        </td><td>
+		  If <code class="literal">sasl_encryption='true'</code>, the JMS client attempts to negotiate a security layer with the broker using GSSAPI to encrypt the connection. Note that for this to happen, GSSAPI must be selected as the sasl_mech.
+	        </td></tr><tr><td>
+		  sasl_protocol
+	        </td><td>
+		  --
+	        </td><td>
+		  Used only for
+		  Kerberos. <code class="literal">sasl_protocol</code> must be
+		  set to the principal for the qpidd broker,
+		  e.g. <code class="literal">qpidd/</code>
+	        </td></tr><tr><td>
+		  sasl_server
+	        </td><td>
+		  --
+	        </td><td>
+		  For Kerberos, sasl_mechs must be set to GSSAPI,
+		  sasl_server must be set to the host for the SASL
+		  server, e.g. <code class="literal">sasl.com</code>.
+	        </td></tr><tr><td>
+		  trust_store
+	        </td><td>
+		  --
+	        </td><td>
+		  path to trust store
+	        </td></tr><tr><td>
+		  trust_store_password
+	        </td><td>
+	        </td><td>
+		  Trust store password
+	        </td></tr><tr><td>
+		  key_store
+	        </td><td>
+	        </td><td>
+		  path to key store
+	        </td></tr><tr><td>
+		  key_store_password
+	        </td><td>
+		  --
+	        </td><td>
+		  key store password
+	        </td></tr><tr><td>
+		  ssl
+	        </td><td>
+		  Boolean
+	        </td><td>
+		  If <code class="literal">ssl='true'</code>, the JMS client will encrypt the connection using SSL.
+	        </td></tr><tr><td>
+		  ssl_verify_hostname
+	        </td><td>
+		  Boolean
+	        </td><td>
+		  When using SSL you can enable hostname verification
+		  by using <code class="literal">ssl_verify_hostname='true'</code> in the broker
+		  URL.
+	        </td></tr><tr><td>
+		  ssl_cert_alias
+	        </td><td>
+
+	        </td><td>
+		  If multiple certificates are present in the keystore, the alias will be used to extract the correct certificate.
+	        </td></tr><tr><td>
+		  retries
+	        </td><td>
+		  integer
+	        </td><td>
+		  The number of times to retry connection to each broker in the broker list. Defaults to 1.
+	        </td></tr><tr><td>
+		  connectdelay
+	        </td><td>
+		  integer
+	        </td><td>
+		  Length of time to wait before attempting to reconnect (in milliseconds). Defaults to 0.
+	        </td></tr><tr><td>
+		  connecttimeout
+	        </td><td>
+		  integer
+	        </td><td>
+		  Length of time to wait for the connection to succeed (in milliseconds).  Defaults to 30000.
+	        </td></tr><tr><td>
+		  tcp_nodelay
+	        </td><td>
+		  Boolean
+	        </td><td>
+		  If <code class="literal">tcp_nodelay='true'</code>, TCP packet
+		  batching is disabled. Defaults to true since Qpid 0.14.
+	        </td></tr></tbody></table></div></div><br class="table-break"></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="QpidJMS.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="QpidJMS.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch03s03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 3. Using the Qpid JMS client </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 3.3. Java JMS Message Properties</td></tr></table></div><div class="main_text_area_bottom"></div></div></div></body></html>

Propchange: qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/QpidJNDI.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/QpidJNDI.html
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/QpidJNDI.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/QpidWCF.html
URL: http://svn.apache.org/viewvc/qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/QpidWCF.html?rev=1368244&view=auto
==============================================================================
--- qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/QpidWCF.html (added)
+++ qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/QpidWCF.html Wed Aug  1 20:54:46 2012
@@ -0,0 +1,226 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Chapter 4. Using the Qpid WCF client</title><link rel="stylesheet" type="text/css" href="css/style.css"><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><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="ch03s06.html" title="3.6. Configuring the JMS Client"><link rel="next" href="ch04s02.html" title="4.2. Endpoints"></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">Downloa
 d</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">0.14 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 hre
 f="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/foun
 dation/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> &gt; <span class="breadcrumb-node">Using the Qpid WCF client</span></DIV><div class="chapter" title="Chapter 4. Using the Qpid WCF client"><div class="titlepage"><div><div><h2 class="title"><a name="QpidWCF"></a>Chapter 4. Using the Qpid WCF client</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="QpidWCF.html#id600626">4.1. XML and Binary Bindings</a></span></dt><dt><span class="section"><a href="ch04s02.html">4.2. Endpoints</a></span></dt><dt><span class="section">
 <a href="ch04s03.html">4.3. Message Headers</a></span></dt><dt><span class="section"><a href="ch04s04.html">4.4. Security</a></span></dt><dt><span class="section"><a href="ch04s05.html">4.5. Transactions</a></span></dt></dl></div><div class="section" title="4.1. XML and Binary Bindings"><div class="titlepage"><div><div><h2 class="title"><a name="id600626"></a>4.1. XML and Binary Bindings</h2></div></div></div><p>The Qpid WCF client provides two bindings, each with support for
+      Windows .NET transactions.</p><p>The AmqpBinding is suitable for communication between two WCF
+      applications.  By default it uses the WCF binary .NET XML encoder
+      (BinaryMessageEncodingBindingElement) for efficient message
+      transmission, but it can also use the text and Message Transmission
+      Optimization Mechanism (MTOM) encoders.  Here is a traditional service
+      model sample program using the AmqpBinding.  It assumes that the queue
+      "hello_service_node" has been created and configured on the AMQP
+      broker.</p><div class="example"><a name="id600643"></a><p class="title"><b>Example 4.1. Traditional service model "Hello world!" example</b></p><div class="example-contents"><pre class="programlisting">
+      namespace Apache.Qpid.Documentation.HelloService
+      {
+      using System;
+      using System.ServiceModel;
+      using System.ServiceModel.Channels;
+      using System.Threading;
+      using Apache.Qpid.Channel;
+
+      [ServiceContract]
+      public interface IHelloService
+      {
+      [OperationContract(IsOneWay = true, Action = "*")]
+      void SayHello(string greeting);
+      }
+
+      public class HelloService : IHelloService
+      {
+      private static int greetingCount;
+
+      public static int GreetingCount
+      {
+      get { return greetingCount; }
+      }
+
+      public void SayHello(string greeting)
+      {
+      Console.WriteLine("Service received: " + greeting);
+      greetingCount++;
+      }</pre><pre class="programlisting">
+      static void Main(string[] args)
+      {
+      try
+      {
+      AmqpBinding amqpBinding = new AmqpBinding();
+      amqpBinding.BrokerHost = "localhost";
+      amqpBinding.BrokerPort = 5672;
+
+      ServiceHost serviceHost = new ServiceHost(typeof(HelloService));
+      serviceHost.AddServiceEndpoint(typeof(IHelloService),
+      amqpBinding, "amqp:hello_service_node");
+      serviceHost.Open();
+
+      // Send the service a test greeting
+      Uri amqpClientUri=new Uri("amqp:amq.direct?routingkey=hello_service_node");
+      EndpointAddress clientEndpoint = new EndpointAddress(amqpClientUri);
+      ChannelFactory&lt;IHelloService&gt; channelFactory =
+      new ChannelFactory&lt;IHelloService&gt;(amqpBinding, clientEndpoint);
+      IHelloService clientProxy = channelFactory.CreateChannel();
+
+      clientProxy.SayHello("Greetings from WCF client");
+
+      // wait for service to process the greeting
+      while (HelloService.GreetingCount == 0)
+      {
+      Thread.Sleep(100);
+      }
+      channelFactory.Close();
+      serviceHost.Close();
+      }
+      catch (Exception e)
+      {
+      Console.WriteLine("Exception: {0}", e);
+      }
+      }
+      }
+      }
+      </pre></div></div><br class="example-break"><p>The second binding, AmqpBinaryBinding, is suitable for WCF
+      applications that need to inter-operate with non-WCF clients or that
+      wish to have direct access to the raw wire representation of the
+      message body.  It relies on a custom encoder to read and write raw
+      (binary) content which operates similarly to the ByteStream encoder
+      (introduced in .NET 4.0).  The encoder presents an abstract XML
+      infoset view of the raw message content on input.  On output, the
+      encoder does the reverse and peels away the XML infoset layer exposing
+      the raw content to the wire representation of the message body.  The
+      application must do the inverse of what the encoder does to allow the
+      XML infoset wrapper to cancel properly.  This is demonstrated in the
+      following sample code (using the channel programming model) which
+      directly manipulates or provides callbacks to the WCF message readers
+      and writers when the content is consumed.  In contrast to the
+      AmqpBinding sample where the simple greeting is encapsulated in a
+      compressed SOAP envelope, the wire representation of the message
+      contains the raw content and is identical and fully interoperable with
+      the Qpid C++ "Hello world!"  example.</p><div class="example"><a name="id600671"></a><p class="title"><b>Example 4.2. Binary  "Hello world!" example using the channel model</b></p><div class="example-contents"><pre class="programlisting">
+      namespace Apache.Qpid.Samples.Channel.HelloWorld
+      {
+      using System;
+      using System.ServiceModel;
+      using System.ServiceModel.Channels;
+      using System.ServiceModel.Description;
+      using System.Text;
+      using System.Xml;
+      using Apache.Qpid.Channel;
+
+      public class HelloWorld
+      {
+      static void Main(string[] args)
+      {
+      String broker = "localhost";
+      int port = 5672;
+      String target = "amq.topic";
+      String source = "my_topic_node";
+
+      if (args.Length &gt; 0)
+      {
+      broker = args[0];
+      }
+
+      if (args.Length &gt; 1)
+      {
+      port = int.Parse(args[1]);
+      }
+
+      if (args.Length &gt; 2)
+      {
+      target = args[2];
+      }
+
+      if (args.Length &gt; 3)
+      {
+      source = args[3];
+      }
+
+      AmqpBinaryBinding binding = new AmqpBinaryBinding();
+      binding.BrokerHost = broker;
+      binding.BrokerPort = port;
+
+      IChannelFactory&lt;IInputChannel&gt; receiverFactory = binding.BuildChannelFactory&lt;IInputChannel&gt;();
+      receiverFactory.Open();
+      IInputChannel receiver = receiverFactory.CreateChannel(new EndpointAddress("amqp:" + source));
+      receiver.Open();
+
+      IChannelFactory&lt;IOutputChannel&gt; senderFactory = binding.BuildChannelFactory&lt;IOutputChannel&gt;();
+      senderFactory.Open();
+      IOutputChannel sender = senderFactory.CreateChannel(new EndpointAddress("amqp:" + target));
+      sender.Open();
+
+      sender.Send(Message.CreateMessage(MessageVersion.None, "", new HelloWorldBinaryBodyWriter()));
+
+      Message message = receiver.Receive();
+      XmlDictionaryReader reader = message.GetReaderAtBodyContents();
+      while (!reader.HasValue)
+      {
+      reader.Read();
+      }
+
+      byte[] binaryContent = reader.ReadContentAsBase64();
+      string text = Encoding.UTF8.GetString(binaryContent);
+
+      Console.WriteLine(text);
+
+      senderFactory.Close();
+      receiverFactory.Close();
+      }
+      }
+
+      public class HelloWorldBinaryBodyWriter : BodyWriter
+      {
+      public HelloWorldBinaryBodyWriter() : base (true) {}
+
+      protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
+      {
+      byte[] binaryContent = Encoding.UTF8.GetBytes("Hello world!");
+
+      // wrap the content:
+      writer.WriteStartElement("Binary");
+      writer.WriteBase64(binaryContent, 0, binaryContent.Length);
+      }
+      }
+      }
+      </pre></div></div><br class="example-break"><p>Bindings define ChannelFactories and ChannelListeners associated with
+      an AMQP Broker.  WCF will frequently automatically create and manage
+      the life cycle of a these and the resulting IChannel objects used in
+      message transfer.  The binding parameters that can be set are:</p><div class="table"><a name="id600721"></a><p class="title"><b>Table 4.1. WCF Binding Parameters</b></p><div class="table-contents"><table summary="WCF Binding Parameters" width="100%" border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Parameter</th><th>Default</th><th>Description</th></tr></thead><tbody><tr><td>
+		BrokerHost
+	      </td><td>
+		localhost
+	      </td><td>
+		The broker's server name.  Currently the WCF channel
+		only supports connections with a single broker.
+		Failover to multiple brokers will be provided in the
+		future.
+	      </td></tr><tr><td>
+		BrokerPort
+	      </td><td>
+		5672
+	      </td><td>
+		The port the broker is listening on.
+	      </td></tr><tr><td>
+		PrefetchLimit
+	      </td><td>
+		0
+	      </td><td>
+		The number of messages to prefetch from the amqp
+		broker before the application actually consumes them.
+		Increasing this number can dramatically increase the
+		read performance in some circumstances.
+	      </td></tr><tr><td>
+		Shared
+	      </td><td>
+		false
+	      </td><td>
+		Indicates if separate channels to the same broker can
+		share an underlying AMQP tcp connection (provided they
+		also share the same authentication credentials).
+	      </td></tr><tr><td>
+		TransferMode
+	      </td><td>
+		buffered
+	      </td><td>
+		Indicates whether the channel's encoder uses the WCF
+		BufferManager cache to temporarily store message
+		content during the encoding/decoding phase.  For small
+		to medium sized SOAP based messages, buffered is
+		usually the preferred choice.  For binary messages,
+		streamed TransferMode is the more efficient mode.
+	      </td></tr></tbody></table></div></div><br class="table-break"></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch03s06.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="ch04s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3.6. Configuring the JMS Client </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 4.2. Endpoints</td></tr></table></div><div class="main_text_area_bottom"></div></div></div></body></html>

Propchange: qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/QpidWCF.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/QpidWCF.html
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/QpidWCF.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/acknowledgements.html
URL: http://svn.apache.org/viewvc/qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/acknowledgements.html?rev=1368244&view=auto
==============================================================================
--- qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/acknowledgements.html (added)
+++ qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/acknowledgements.html Wed Aug  1 20:54:46 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" type="text/css" href="css/style.css"><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><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="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 hr
 ef="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">0.14 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/mai
 ling_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">Hom
 e</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> &gt; <span class="breadcrumb-link"><a href="ch02.html">Using the Qpid Messaging API</a></span> &gt; <span class="breadcrumb-node">Acknowledging Received Messages</span></DIV><div class="section" title="2.7. Acknowledging Received Messages"><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>

Propchange: qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/acknowledgements.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/acknowledgements.html
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/acknowledgements.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch01.html
URL: http://svn.apache.org/viewvc/qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch01.html?rev=1368244&view=auto
==============================================================================
--- qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch01.html (added)
+++ qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch01.html Wed Aug  1 20:54:46 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" type="text/css" href="css/style.css"><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><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="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">Downl
 oad</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">0.14 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 h
 ref="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/fo
 undation/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> &gt; <span class="breadcrumb-node">Introduction</span></DIV><div class="chapter" title="Chapter 1. Introduction"><div class="titlepage"><div><div><h2 class="title"><a name="id579125"></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 class="itemizedlist"><li class="listitem"><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 class="listitem"><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 class="listitem"><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>

Propchange: qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch01.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch01.html
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch01.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch02.html
URL: http://svn.apache.org/viewvc/qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch02.html?rev=1368244&view=auto
==============================================================================
--- qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch02.html (added)
+++ qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch02.html Wed Aug  1 20:54:46 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" type="text/css" href="css/style.css"><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><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="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">0.14 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 Li
 sts</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> &gt; <span class="breadcrumb-node">Using the Qpid Messaging API</span></DIV><div class="chapter" title="Chapter 2. Using the Qpid Messaging API"><div class="titlepage"><div><div><h2 class="title"><a name="id576622"></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#id548056">2.1. A Simple Messaging Program in C++</a></span></dt><dt><span class="section"><a href="ch02s02.html">2.2. A Simple Mes
 saging 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#id594225">2.4.1. Address Strings</a></span></dt><dt><span class="section"><a href="section-addresses.html#id594268">2.4.2. Subjects</a></span></dt><dt><span class="section"><a href="section-addresses.html#id594606">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 Messag
 es</a></span></dt><dt><span class="section"><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></s
 pan></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#id597305">2.15.1. Logging in C++</a></span></dt><dt><span class="section"><a href="ch02s15.html#id597347">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-sendin
 g">2.17.2. Sending Grouped Messages</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 class="itemizedlist"><li class="listitem"><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 class="listitem"><p>
+          A <em class="firstterm">connection</em> represents a network
+          connection to a remote endpoint.
+        </p></li><li class="listitem"><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 class="listitem"><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 class="listitem"><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" title="2.1. A Simple Messaging Program in C++"><div class="titlepage"><div><div><h2 class="title"><a name="id548056"></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="id548067"></a><p class="title"><b>Example 2.1. "Hello world!" in C++</b></p><div class="example-contents"><pre lang="c++" class="programlisting">
+	#include &lt;qpid/messaging/Connection.h&gt;
+	#include &lt;qpid/messaging/Message.h&gt;
+	#include &lt;qpid/messaging/Receiver.h&gt;
+	#include &lt;qpid/messaging/Sender.h&gt;
+	#include &lt;qpid/messaging/Session.h&gt;
+
+	#include &lt;iostream&gt;
+
+	using namespace qpid::messaging;
+
+	int main(int argc, char** argv) {
+	std::string broker = argc &gt; 1 ? argv[1] : "localhost:5672";
+	std::string address = argc &gt; 2 ? argv[2] : "amq.topic";
+	std::string connectionOptions = argc &gt; 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 &lt;&lt; message.getContent() &lt;&lt; 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&amp; error) {
+        std::cerr &lt;&lt; error.what() &lt;&lt; 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>

Propchange: qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch02.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch02.html
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch02.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch02s02.html
URL: http://svn.apache.org/viewvc/qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch02s02.html?rev=1368244&view=auto
==============================================================================
--- qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch02s02.html (added)
+++ qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch02s02.html Wed Aug  1 20:54:46 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" type="text/css" href="css/style.css"><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><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="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><L
 I><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">0.14 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.o
 rg">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> &gt; <span class="breadcrumb-link"><a href="ch02.html">Using the Qpid Messaging API</a></span> &gt; <span class="breadcrumb-node">A Simple Messaging Program in Python</span></DIV><div class="section" title="2.2. A Simple Messaging Program in Python"><div class="titlepage"><div><div><h2 class="title"><a name="id547880"></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="id547891"></a><p class="title"><b>Example 2.2. "Hello world!" in Python</b></p><div class="example-contents"><pre lang="python" class="programlisting">
+	import sys
+	from qpid.messaging import *
+
+	broker =  "localhost:5672" if len(sys.argv)&lt;2 else sys.argv[1]
+	address = "amq.topic" if len(sys.argv)&lt;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>

Propchange: qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch02s02.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch02s02.html
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch02s02.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch02s03.html
URL: http://svn.apache.org/viewvc/qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch02s03.html?rev=1368244&view=auto
==============================================================================
--- qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch02s03.html (added)
+++ qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch02s03.html Wed Aug  1 20:54:46 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" type="text/css" href="css/style.css"><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><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="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="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">0.14 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_lis
 ts.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></L
 I><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> &gt; <span class="breadcrumb-link"><a href="ch02.html">Using the Qpid Messaging API</a></span> &gt; <span class="breadcrumb-node">A Simple Messaging Program in .NET C#</span></DIV><div class="section" title="2.3. A Simple Messaging Program in .NET C#"><div class="titlepage"><div><div><h2 class="title"><a name="id593690"></a>2.3. A Simple Messaging Program in .NET C#</h2></div></div></div><p>The following .NET C#
+      <sup>[<a name="id593697" href="#ftn.id593697" 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="id593708"></a><p class="title"><b>Example 2.3. "Hello world!" in .NET C#</b></p><div class="example-contents"><pre lang="c++" 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 &gt; 0 ? args[0] : "localhost:5672";
+	  String address = args.Length &gt; 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 id="ftn.id593697" href="#id593697" 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>

Propchange: qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch02s03.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch02s03.html
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch02s03.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch02s08.html
URL: http://svn.apache.org/viewvc/qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch02s08.html?rev=1368244&view=auto
==============================================================================
--- qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch02s08.html (added)
+++ qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch02s08.html Wed Aug  1 20:54:46 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" type="text/css" href="css/style.css"><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><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="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="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">0.14 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_lis
 ts.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></L
 I><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> &gt; <span class="breadcrumb-link"><a href="ch02.html">Using the Qpid Messaging API</a></span> &gt; <span class="breadcrumb-node">Receiving Messages from Multiple Sources</span></DIV><div class="section" title="2.8. Receiving Messages from Multiple Sources"><div class="titlepage"><div><div><h2 class="title"><a name="id595826"></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="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="id595850"></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 &lt;&lt; message.getContent() &lt;&lt; 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>

Propchange: qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch02s08.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch02s08.html
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: qpid/site/docs/books/trunk/Programming-In-Apache-Qpid-Book/html/ch02s08.html
------------------------------------------------------------------------------
    svn:mime-type = text/html



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message