http://git-wip-us.apache.org/repos/asf/qpid-site/blob/c3ab60f6/content/releases/qpid-cpp-1.39.0/messaging-api/book/Message-Groups-Guide.html ---------------------------------------------------------------------- diff --git a/content/releases/qpid-cpp-1.39.0/messaging-api/book/Message-Groups-Guide.html b/content/releases/qpid-cpp-1.39.0/messaging-api/book/Message-Groups-Guide.html new file mode 100644 index 0000000..5552917 --- /dev/null +++ b/content/releases/qpid-cpp-1.39.0/messaging-api/book/Message-Groups-Guide.html @@ -0,0 +1,242 @@ +<!DOCTYPE html> +<!-- + - + - Licensed to the Apache Software Foundation (ASF) under one + - or more contributor license agreements. See the NOTICE file + - distributed with this work for additional information + - regarding copyright ownership. The ASF licenses this file + - to you under the Apache License, Version 2.0 (the + - "License"); you may not use this file except in compliance + - with the License. You may obtain a copy of the License at + - + - http://www.apache.org/licenses/LICENSE-2.0 + - + - Unless required by applicable law or agreed to in writing, + - software distributed under the License is distributed on an + - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + - KIND, either express or implied. See the License for the + - specific language governing permissions and limitations + - under the License. + - +--> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> + <head> + <title>1.17. Using Message Groups - Apache Qpid™</title> + <meta http-equiv="X-UA-Compatible" content="IE=edge"/> + <meta name="viewport" content="width=device-width, initial-scale=1.0"/> + <link rel="stylesheet" href="/site.css" type="text/css" async="async"/> + <link rel="stylesheet" href="/deferred.css" type="text/css" defer="defer"/> + <script type="text/javascript">var _deferredFunctions = [];</script> + <script type="text/javascript" src="/deferred.js" defer="defer"></script> + <!--[if lte IE 8]> + <link rel="stylesheet" href="/ie.css" type="text/css"/> + <script type="text/javascript" src="/html5shiv.js"></script> + <![endif]--> + + <!-- Redirects for `go get` and godoc.org --> + <meta name="go-import" + content="qpid.apache.org git https://git-wip-us.apache.org/repos/asf/qpid-proton.git"/> + <meta name="go-source" + content="qpid.apache.org +https://github.com/apache/qpid-proton/blob/go1/README.md +https://github.com/apache/qpid-proton/tree/go1{/dir} +https://github.com/apache/qpid-proton/blob/go1{/dir}/{file}#L{line}"/> + </head> + <body> + <div id="-content"> + <div id="-top" class="panel"> + <a id="-menu-link"><img width="16" height="16" src="" alt="Menu"/></a> + + <a id="-search-link"><img width="22" height="16" src="" alt="Search"/></a> + + <ul id="-global-navigation"> + <li><a id="-logotype" href="/index.html">Apache Qpid<sup>™</sup></a></li> + <li><a href="/documentation.html">Documentation</a></li> + <li><a href="/download.html">Download</a></li> + <li><a href="/discussion.html">Discussion</a></li> + </ul> + </div> + + <div id="-menu" class="panel" style="display: none;"> + <div class="flex"> + <section> + <h3>Project</h3> + + <ul> + <li><a href="/overview.html">Overview</a></li> + <li><a href="/components/index.html">Components</a></li> + <li><a href="/releases/index.html">Releases</a></li> + </ul> + </section> + + <section> + <h3>Messaging APIs</h3> + + <ul> + <li><a href="/proton/index.html">Qpid Proton</a></li> + <li><a href="/components/jms/index.html">Qpid JMS</a></li> + <li><a href="/components/messaging-api/index.html">Qpid Messaging API</a></li> + </ul> + </section> + + <section> + <h3>Servers and tools</h3> + + <ul> + <li><a href="/components/broker-j/index.html">Broker-J</a></li> + <li><a href="/components/cpp-broker/index.html">C++ broker</a></li> + <li><a href="/components/dispatch-router/index.html">Dispatch router</a></li> + </ul> + </section> + + <section> + <h3>Resources</h3> + + <ul> + <li><a href="/dashboard.html">Dashboard</a></li> + <li><a href="https://cwiki.apache.org/confluence/display/qpid/Index">Wiki</a></li> + <li><a href="/resources.html">More resources</a></li> + </ul> + </section> + </div> + </div> + + <div id="-search" class="panel" style="display: none;"> + <form action="http://www.google.com/search" method="get"> + <input type="hidden" name="sitesearch" value="qpid.apache.org"/> + <input type="text" name="q" maxlength="255" autofocus="autofocus" tabindex="1"/> + <button type="submit">Search</button> + <a href="/search.html">More ways to search</a> + </form> + </div> + + <div id="-middle" class="panel"> + <ul id="-path-navigation"><li><a href="/index.html">Home</a></li><li><a href="/releases/index.html">Releases</a></li><li><a href="/releases/qpid-cpp-1.39.0/index.html">Qpid C++ 1.39.0</a></li><li><a href="/releases/qpid-cpp-1.39.0/messaging-api/book/index.html">Using the Qpid Messaging API</a></li><li>1.17. Using Message Groups</li></ul> + + <div id="-middle-content"> + <div class="docbook"><div class="navheader"><table summary="Navigation header" width="100%"><tr><th align="center" colspan="3">1.17. Using Message Groups</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="section-amqp0-10-mapping.html">Prev</a> </td><th align="center" width="60%">Chapter 1. Using the Qpid Messaging API</th><td align="right" width="20%"> <a accesskey="n" href="ch02.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="Message-Groups-Guide"></a>1.17. Using Message Groups</h2></div></div></div><p> + This section describes how messaging applications can use the Message Group feature + provided by the Broker. + </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3> + The content of this section assumes the reader is familiar with the Message Group + feature as described in the AMQP Messaging Broker user's guide. Please read the + message grouping section in the Broker user's guide before using the + examples given in this section. + </div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="messagegroups-setup"></a>1.17.1. Creating Message Group Queues</h3></div></div></div><p> + The following examples show how to create a message group queue that enforces + ordered group consumption across multiple consumers. + </p><div class="example"><a id="idm140612067785264"></a><p class="title"><strong>Example 1.22. Message Group Queue Creation - Python</strong></p><div class="example-contents"><pre class="programlisting" lang="python" xml:lang="python"> +sender = connection.session().sender("msg-group-q;" + + " {create:always, delete:receiver," + + " node: {x-declare: {arguments:" + + " {'qpid.group_header_key':'THE-GROUP'," + + " 'qpid.shared_msg_group':1}}}}") + </pre></div></div><br class="example-break" /><div class="example"><a id="idm140612067783456"></a><p class="title"><strong>Example 1.23. Message Group Queue Creation - C++</strong></p><div class="example-contents"><pre class="programlisting" lang="c++" xml:lang="c++"> +std::string addr("msg-group-q; " + " {create:always, delete:receiver," + " node: {x-declare: {arguments:" + " {qpid.group_header_key:'THE-GROUP'," + " qpid.shared_msg_group:1}}}}"); +Sender sender = session.createSender(addr); + </pre></div></div><br class="example-break" /><div class="example"><a id="idm140612067782016"></a><p class="title"><strong>Example 1.24. Message Group Queue Creation - Java</strong></p><div class="example-contents"><pre class="programlisting" lang="java" xml:lang="java"> +Session s = c.createSession(false, Session.CLIENT_ACKNOWLEDGE); +String addr = "msg-group-q; {create:always, delete:receiver," + + " node: {x-declare: {arguments:" + + " {'qpid.group_header_key':'THE-GROUP'," + + " 'qpid.shared_msg_group':1}}}}"; +Destination d = (Destination) new AMQAnyDestination(addr); +MessageProducer sender = s.createProducer(d); + </pre></div></div><br class="example-break" /><p> + The example code uses the x-declare map to specify the message group configuration + that should be used for the queue. See the AMQP Messaging Broker user's guide + for a detailed description of these arguments. Note that the + qpid.group_header_key's value MUST be a string type if using the C++ broker. + </p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="messagegroups-sending"></a>1.17.2. Sending Grouped Messages</h3></div></div></div><p> + When sending grouped messages, the client must add a message property containing the + group identifier to the outgoing message. If using the C++ broker, the group identifier + must be a string type. The key used for the property must exactly match the value passed in the + 'qpid.group_header_key' configuration argument. + </p><div class="example"><a id="idm140612073762496"></a><p class="title"><strong>Example 1.25. Sending Grouped Messages - Python</strong></p><div class="example-contents"><pre class="programlisting" lang="python" xml:lang="python"> +group = "A" +m = Message(content="some data", properties={"THE-GROUP": group}) +sender.send(m) + +group = "B" +m = Message(content="some other group's data", properties={"THE-GROUP": group}) +sender.send(m) + +group = "A" +m = Message(content="more data for group 'A'", properties={"THE-GROUP": group}) +sender.send(m) + </pre></div></div><br class="example-break" /><div class="example"><a id="idm140612073760720"></a><p class="title"><strong>Example 1.26. Sending Grouped Messages - C++</strong></p><div class="example-contents"><pre class="programlisting" lang="C++" xml:lang="C++"> + +const std::string groupKey("THE-GROUP"); +{ + Message msg("some data"); + msg.getProperties()[groupKey] = std::string("A"); + sender.send(msg); +} +{ + Message msg("some other group's data"); + msg.getProperties()[groupKey] = std::string("B"); + sender.send(msg); +} +{ + Message msg("more data for group 'A'"); + msg.getProperties()[groupKey] = std::string("A"); + sender.send(msg); +} + </pre></div></div><br class="example-break" /><div class="example"><a id="idm140612073758864"></a><p class="title"><strong>Example 1.27. Sending Grouped Messages - Java</strong></p><div class="example-contents"><pre class="programlisting" lang="java" xml:lang="java"> +String groupKey = "THE-GROUP"; + +TextMessage tmsg1 = s.createTextMessage("some data"); +tmsg1.setStringProperty(groupKey, "A"); +sender.send(tmsg1); + +TextMessage tmsg2 = s.createTextMessage("some other group's data"); +tmsg2.setStringProperty(groupKey, "B"); +sender.send(tmsg2); + +TextMessage tmsg3 = s.createTextMessage("more data for group 'A'"); +tmsg3.setStringProperty(groupKey, "A"); +sender.send(tmsg3); + </pre></div></div><br class="example-break" /><p> + The examples above send two groups worth of messages to the queue created in the + previous example. Two messages belong to group "A", and one belongs to group + "B". Note that it is not necessary to complete sending one group's messages before + starting another. Also note that there is no need to indicate to the broker when a + new group is created or an existing group retired - the broker tracks group state + automatically. + </p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="messagegroups-receiving"></a>1.17.3. Receiving Grouped Messages</h3></div></div></div><p> + Since the broker enforces group policy when delivering messages, no special actions + are necessary for receiving grouped messages from the broker. However, applications + must adhere to the rules for message group consumption as described in the AMQP + Messaging Broker user's guide. + </p></div></div><div class="navfooter"><hr /><table summary="Navigation footer" width="100%"><tr><td align="left" width="40%"><a accesskey="p" href="section-amqp0-10-mapping.html">Prev</a> </td><td align="center" width="20%"><a accesskey="u" href="using-the-qpid-messaging-api.html">Up</a></td><td align="right" width="40%"> <a accesskey="n" href="ch02.html">Next</a></td></tr><tr><td align="left" valign="top" width="40%">1.16. The AMQP 0-10 mapping </td><td align="center" width="20%"><a accesskey="h" href="index.html">Home</a></td><td align="right" valign="top" width="40%"> Chapter 2. The .NET Binding for the C++ Messaging Client</td></tr></table></div></div> + + <hr/> + + <ul id="-apache-navigation"> + <li><a href="http://www.apache.org/">Apache</a></li> + <li><a href="http://www.apache.org/licenses/">License</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="/security.html">Security</a></li> + <li><a href="http://www.apache.org/"><img id="-apache-feather" width="48" height="14" src="" alt="Apache"/></a></li> + </ul> + + <p id="-legal"> + Apache Qpid, Messaging built on AMQP; Copyright © 2015 + The Apache Software Foundation; Licensed under + the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache + License, Version 2.0</a>; Apache Qpid, Qpid, Qpid Proton, + Proton, Apache, the Apache feather logo, and the Apache Qpid + project logo are trademarks of The Apache Software + Foundation; All other marks mentioned may be trademarks or + registered trademarks of their respective owners + </p> + </div> + </div> + </div> + </body> +</html>
http://git-wip-us.apache.org/repos/asf/qpid-site/blob/c3ab60f6/content/releases/qpid-cpp-1.39.0/messaging-api/book/acknowledgements.html ---------------------------------------------------------------------- diff --git a/content/releases/qpid-cpp-1.39.0/messaging-api/book/acknowledgements.html b/content/releases/qpid-cpp-1.39.0/messaging-api/book/acknowledgements.html new file mode 100644 index 0000000..063cd39 --- /dev/null +++ b/content/releases/qpid-cpp-1.39.0/messaging-api/book/acknowledgements.html @@ -0,0 +1,164 @@ +<!DOCTYPE html> +<!-- + - + - Licensed to the Apache Software Foundation (ASF) under one + - or more contributor license agreements. See the NOTICE file + - distributed with this work for additional information + - regarding copyright ownership. The ASF licenses this file + - to you under the Apache License, Version 2.0 (the + - "License"); you may not use this file except in compliance + - with the License. You may obtain a copy of the License at + - + - http://www.apache.org/licenses/LICENSE-2.0 + - + - Unless required by applicable law or agreed to in writing, + - software distributed under the License is distributed on an + - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + - KIND, either express or implied. See the License for the + - specific language governing permissions and limitations + - under the License. + - +--> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> + <head> + <title>1.7. Acknowledging Received Messages - Apache Qpid™</title> + <meta http-equiv="X-UA-Compatible" content="IE=edge"/> + <meta name="viewport" content="width=device-width, initial-scale=1.0"/> + <link rel="stylesheet" href="/site.css" type="text/css" async="async"/> + <link rel="stylesheet" href="/deferred.css" type="text/css" defer="defer"/> + <script type="text/javascript">var _deferredFunctions = [];</script> + <script type="text/javascript" src="/deferred.js" defer="defer"></script> + <!--[if lte IE 8]> + <link rel="stylesheet" href="/ie.css" type="text/css"/> + <script type="text/javascript" src="/html5shiv.js"></script> + <![endif]--> + + <!-- Redirects for `go get` and godoc.org --> + <meta name="go-import" + content="qpid.apache.org git https://git-wip-us.apache.org/repos/asf/qpid-proton.git"/> + <meta name="go-source" + content="qpid.apache.org +https://github.com/apache/qpid-proton/blob/go1/README.md +https://github.com/apache/qpid-proton/tree/go1{/dir} +https://github.com/apache/qpid-proton/blob/go1{/dir}/{file}#L{line}"/> + </head> + <body> + <div id="-content"> + <div id="-top" class="panel"> + <a id="-menu-link"><img width="16" height="16" src="" alt="Menu"/></a> + + <a id="-search-link"><img width="22" height="16" src="" alt="Search"/></a> + + <ul id="-global-navigation"> + <li><a id="-logotype" href="/index.html">Apache Qpid<sup>™</sup></a></li> + <li><a href="/documentation.html">Documentation</a></li> + <li><a href="/download.html">Download</a></li> + <li><a href="/discussion.html">Discussion</a></li> + </ul> + </div> + + <div id="-menu" class="panel" style="display: none;"> + <div class="flex"> + <section> + <h3>Project</h3> + + <ul> + <li><a href="/overview.html">Overview</a></li> + <li><a href="/components/index.html">Components</a></li> + <li><a href="/releases/index.html">Releases</a></li> + </ul> + </section> + + <section> + <h3>Messaging APIs</h3> + + <ul> + <li><a href="/proton/index.html">Qpid Proton</a></li> + <li><a href="/components/jms/index.html">Qpid JMS</a></li> + <li><a href="/components/messaging-api/index.html">Qpid Messaging API</a></li> + </ul> + </section> + + <section> + <h3>Servers and tools</h3> + + <ul> + <li><a href="/components/broker-j/index.html">Broker-J</a></li> + <li><a href="/components/cpp-broker/index.html">C++ broker</a></li> + <li><a href="/components/dispatch-router/index.html">Dispatch router</a></li> + </ul> + </section> + + <section> + <h3>Resources</h3> + + <ul> + <li><a href="/dashboard.html">Dashboard</a></li> + <li><a href="https://cwiki.apache.org/confluence/display/qpid/Index">Wiki</a></li> + <li><a href="/resources.html">More resources</a></li> + </ul> + </section> + </div> + </div> + + <div id="-search" class="panel" style="display: none;"> + <form action="http://www.google.com/search" method="get"> + <input type="hidden" name="sitesearch" value="qpid.apache.org"/> + <input type="text" name="q" maxlength="255" autofocus="autofocus" tabindex="1"/> + <button type="submit">Search</button> + <a href="/search.html">More ways to search</a> + </form> + </div> + + <div id="-middle" class="panel"> + <ul id="-path-navigation"><li><a href="/index.html">Home</a></li><li><a href="/releases/index.html">Releases</a></li><li><a href="/releases/qpid-cpp-1.39.0/index.html">Qpid C++ 1.39.0</a></li><li><a href="/releases/qpid-cpp-1.39.0/messaging-api/book/index.html">Using the Qpid Messaging API</a></li><li>1.7. Acknowledging Received Messages</li></ul> + + <div id="-middle-content"> + <div class="docbook"><div class="navheader"><table summary="Navigation header" width="100%"><tr><th align="center" colspan="3">1.7. Acknowledging Received Messages</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="prefetch.html">Prev</a> </td><th align="center" width="60%">Chapter 1. Using the Qpid Messaging API</th><td align="right" width="20%"> <a accesskey="n" href="ch01s08.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="acknowledgements"></a>1.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 1.3. Link Properties">Table 1.3, “Link Properties”</a>).</p><p>The acknowledge call acknowledges all messages received on + the session (i.e. all message that have been returned from a fetch + call on a receiver created on that session).</p><p>The acknowledge call also support an optional parameter + controlling whether the call is synchronous or not. A synchronous + acknowledge will block until the server has confirmed that it has + received the acknowledgement. In the asynchronous case, when the + call returns there is not yet any guarantee that the server has + received and processed the acknowledgement. The session may be + queried for the number of unsettled acknowledgements; when that + count is zero all acknowledgements made for received messages have + been successful.</p></div><div class="navfooter"><hr /><table summary="Navigation footer" width="100%"><tr><td align="left" width="40%"><a accesskey="p" href="prefetch.html">Prev</a> </td><td align="center" width="20%"><a accesskey="u" href="using-the-qpid-messaging-api.html">Up</a></td><td align="right" width="40%"> <a accesskey="n" href="ch01s08.html">Next</a></td></tr><tr><td align="left" valign="top" width="40%">1.6. Receiver Capacity (Prefetch) </td><td align="center" width="20%"><a accesskey="h" href="index.html">Home</a></td><td align="right" valign="top" width="40%"> 1.8. Receiving Messages from Multiple Sources</td></tr></table></div></div> + + <hr/> + + <ul id="-apache-navigation"> + <li><a href="http://www.apache.org/">Apache</a></li> + <li><a href="http://www.apache.org/licenses/">License</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="/security.html">Security</a></li> + <li><a href="http://www.apache.org/"><img id="-apache-feather" width="48" height="14" src="" alt="Apache"/></a></li> + </ul> + + <p id="-legal"> + Apache Qpid, Messaging built on AMQP; Copyright © 2015 + The Apache Software Foundation; Licensed under + the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache + License, Version 2.0</a>; Apache Qpid, Qpid, Qpid Proton, + Proton, Apache, the Apache feather logo, and the Apache Qpid + project logo are trademarks of The Apache Software + Foundation; All other marks mentioned may be trademarks or + registered trademarks of their respective owners + </p> + </div> + </div> + </div> + </body> +</html> http://git-wip-us.apache.org/repos/asf/qpid-site/blob/c3ab60f6/content/releases/qpid-cpp-1.39.0/messaging-api/book/ch01s02.html ---------------------------------------------------------------------- diff --git a/content/releases/qpid-cpp-1.39.0/messaging-api/book/ch01s02.html b/content/releases/qpid-cpp-1.39.0/messaging-api/book/ch01s02.html new file mode 100644 index 0000000..f69f9c5 --- /dev/null +++ b/content/releases/qpid-cpp-1.39.0/messaging-api/book/ch01s02.html @@ -0,0 +1,174 @@ +<!DOCTYPE html> +<!-- + - + - Licensed to the Apache Software Foundation (ASF) under one + - or more contributor license agreements. See the NOTICE file + - distributed with this work for additional information + - regarding copyright ownership. The ASF licenses this file + - to you under the Apache License, Version 2.0 (the + - "License"); you may not use this file except in compliance + - with the License. You may obtain a copy of the License at + - + - http://www.apache.org/licenses/LICENSE-2.0 + - + - Unless required by applicable law or agreed to in writing, + - software distributed under the License is distributed on an + - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + - KIND, either express or implied. See the License for the + - specific language governing permissions and limitations + - under the License. + - +--> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> + <head> + <title>1.2. A Simple Messaging Program in Python - Apache Qpid™</title> + <meta http-equiv="X-UA-Compatible" content="IE=edge"/> + <meta name="viewport" content="width=device-width, initial-scale=1.0"/> + <link rel="stylesheet" href="/site.css" type="text/css" async="async"/> + <link rel="stylesheet" href="/deferred.css" type="text/css" defer="defer"/> + <script type="text/javascript">var _deferredFunctions = [];</script> + <script type="text/javascript" src="/deferred.js" defer="defer"></script> + <!--[if lte IE 8]> + <link rel="stylesheet" href="/ie.css" type="text/css"/> + <script type="text/javascript" src="/html5shiv.js"></script> + <![endif]--> + + <!-- Redirects for `go get` and godoc.org --> + <meta name="go-import" + content="qpid.apache.org git https://git-wip-us.apache.org/repos/asf/qpid-proton.git"/> + <meta name="go-source" + content="qpid.apache.org +https://github.com/apache/qpid-proton/blob/go1/README.md +https://github.com/apache/qpid-proton/tree/go1{/dir} +https://github.com/apache/qpid-proton/blob/go1{/dir}/{file}#L{line}"/> + </head> + <body> + <div id="-content"> + <div id="-top" class="panel"> + <a id="-menu-link"><img width="16" height="16" src="" alt="Menu"/></a> + + <a id="-search-link"><img width="22" height="16" src="" alt="Search"/></a> + + <ul id="-global-navigation"> + <li><a id="-logotype" href="/index.html">Apache Qpid<sup>™</sup></a></li> + <li><a href="/documentation.html">Documentation</a></li> + <li><a href="/download.html">Download</a></li> + <li><a href="/discussion.html">Discussion</a></li> + </ul> + </div> + + <div id="-menu" class="panel" style="display: none;"> + <div class="flex"> + <section> + <h3>Project</h3> + + <ul> + <li><a href="/overview.html">Overview</a></li> + <li><a href="/components/index.html">Components</a></li> + <li><a href="/releases/index.html">Releases</a></li> + </ul> + </section> + + <section> + <h3>Messaging APIs</h3> + + <ul> + <li><a href="/proton/index.html">Qpid Proton</a></li> + <li><a href="/components/jms/index.html">Qpid JMS</a></li> + <li><a href="/components/messaging-api/index.html">Qpid Messaging API</a></li> + </ul> + </section> + + <section> + <h3>Servers and tools</h3> + + <ul> + <li><a href="/components/broker-j/index.html">Broker-J</a></li> + <li><a href="/components/cpp-broker/index.html">C++ broker</a></li> + <li><a href="/components/dispatch-router/index.html">Dispatch router</a></li> + </ul> + </section> + + <section> + <h3>Resources</h3> + + <ul> + <li><a href="/dashboard.html">Dashboard</a></li> + <li><a href="https://cwiki.apache.org/confluence/display/qpid/Index">Wiki</a></li> + <li><a href="/resources.html">More resources</a></li> + </ul> + </section> + </div> + </div> + + <div id="-search" class="panel" style="display: none;"> + <form action="http://www.google.com/search" method="get"> + <input type="hidden" name="sitesearch" value="qpid.apache.org"/> + <input type="text" name="q" maxlength="255" autofocus="autofocus" tabindex="1"/> + <button type="submit">Search</button> + <a href="/search.html">More ways to search</a> + </form> + </div> + + <div id="-middle" class="panel"> + <ul id="-path-navigation"><li><a href="/index.html">Home</a></li><li><a href="/releases/index.html">Releases</a></li><li><a href="/releases/qpid-cpp-1.39.0/index.html">Qpid C++ 1.39.0</a></li><li><a href="/releases/qpid-cpp-1.39.0/messaging-api/book/index.html">Using the Qpid Messaging API</a></li><li>1.2. A Simple Messaging Program in Python</li></ul> + + <div id="-middle-content"> + <div class="docbook"><div class="navheader"><table summary="Navigation header" width="100%"><tr><th align="center" colspan="3">1.2. A Simple Messaging Program in Python</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="using-the-qpid-messaging-api.html">Prev</a> </td><th align="center" width="60%">Chapter 1. Using the Qpid Messaging API</th><td align="right" width="20%"> <a accesskey="n" href="ch01s03.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="idm140612073699520"></a>1.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 id="idm140612073698272"></a><p class="title"><strong>Example 1.2. "Hello world!" in Python</strong></p><div class="example-contents"><pre class="programlisting" lang="python" xml:lang="python"> + 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" href="ch01s02.html#callout-python-open" id="hello-python-open">(1)</a> + session = connection.session() <a class="co" href="ch01s02.html#callout-python-session" id="hello-python-session">(2)</a> + + sender = session.sender(address) <a class="co" href="ch01s02.html#callout-python-sender" id="hello-python-sender">(3)</a> + receiver = session.receiver(address) <a class="co" href="ch01s02.html#callout-python-receiver" id="hello-python-receiver">(4)</a> + + sender.send(Message("Hello world!")); + + message = receiver.fetch(timeout=1) <a class="co" href="ch01s02.html#callout-python-fetch" id="hello-python-fetch">(5)</a> + print message.content + session.acknowledge() <a class="co" href="ch01s02.html#callout-python-acknowledge" id="hello-python-acknowledge">(6)</a> + + except MessagingError,m: + print m + finally: + connection.close() <a class="co" href="ch01s02.html#callout-python-close" id="hello-python-close">(7)</a> + </pre><div class="calloutlist"><table border="0" summary="Callout list"><tr><td align="left" valign="top" width="5%"><p><a id="callout-python-open"></a><a href="#hello-python-open">(1)</a> </p></td><td align="left" valign="top"><p>Establishes the connection with the messaging broker.</p></td></tr><tr><td align="left" valign="top" width="5%"><p><a id="callout-python-session"></a><a href="#hello-python-session">(2)</a> </p></td><td align="left" valign="top"><p>Creates a session object on which messages will be sent and received.</p></td></tr><tr><td align="left" valign="top" width="5%"><p><a id="callout-python-receiver"></a><a href="#hello-python-receiver">(4)</a> </p></td><td align="left" valign="top"><p>Creates a receiver that receives messages from the given address.</p></td></tr><tr><td align="left" valign="top" width="5%"><p><a id="callout-python-sender"></a><a href="#hello-python-sender">(3)</a> </p></td><td align="left" valign="top"><p>Creates a sender that sends to the given address.</p></td></tr><tr><td align="left" valign="top" width="5%"><p><a id="callout-python-fetch"></a><a href="#hello-python-fetch">(5)</a> </p></td><td align="left" valign="top"><p>Receives the next message. The duration is optional, if omitted, will wait indefinitely for the next message.</p></td></tr><tr><td align="left" valign="top" width="5%"><p><a id="callout-python-acknowledge"></a><a href="#hello-python-acknowledge">(6)</a> </p></td><td align="left" valign="top"><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 align="left" valign="top" width="5%"><p><a id="callout-python-close"></a><a href="#hello-python-close">(7)</a> </p></td><td align="left" valign="top"><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 class="navfooter"><hr /><table summary="Navigation footer" width="100%"><tr><td align="left" width="40%"><a accesskey="p" href="using-the-qpid-messaging-api.html">Prev</a> </td><td align="center" width="20%"><a accesskey="u" href="using-the-qpid-messaging-api.html">Up</a></td><td align="right" width="40%"> <a accesskey="n" href="ch01s03.html">Next</a></td></tr><tr><td align="left" valign="top" width="40%">Chapter 1. Using the Qpid Messaging API </td><td align="center" width="20%"><a accesskey="h" href="index.html">Home</a></td><td align=" right" valign="top" width="40%"> 1.3. A Simple Messaging Program in .NET C#</td></tr></table></div></div> + + <hr/> + + <ul id="-apache-navigation"> + <li><a href="http://www.apache.org/">Apache</a></li> + <li><a href="http://www.apache.org/licenses/">License</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="/security.html">Security</a></li> + <li><a href="http://www.apache.org/"><img id="-apache-feather" width="48" height="14" src="" alt="Apache"/></a></li> + </ul> + + <p id="-legal"> + Apache Qpid, Messaging built on AMQP; Copyright © 2015 + The Apache Software Foundation; Licensed under + the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache + License, Version 2.0</a>; Apache Qpid, Qpid, Qpid Proton, + Proton, Apache, the Apache feather logo, and the Apache Qpid + project logo are trademarks of The Apache Software + Foundation; All other marks mentioned may be trademarks or + registered trademarks of their respective owners + </p> + </div> + </div> + </div> + </body> +</html> http://git-wip-us.apache.org/repos/asf/qpid-site/blob/c3ab60f6/content/releases/qpid-cpp-1.39.0/messaging-api/book/ch01s03.html ---------------------------------------------------------------------- diff --git a/content/releases/qpid-cpp-1.39.0/messaging-api/book/ch01s03.html b/content/releases/qpid-cpp-1.39.0/messaging-api/book/ch01s03.html new file mode 100644 index 0000000..c8c285c --- /dev/null +++ b/content/releases/qpid-cpp-1.39.0/messaging-api/book/ch01s03.html @@ -0,0 +1,191 @@ +<!DOCTYPE html> +<!-- + - + - Licensed to the Apache Software Foundation (ASF) under one + - or more contributor license agreements. See the NOTICE file + - distributed with this work for additional information + - regarding copyright ownership. The ASF licenses this file + - to you under the Apache License, Version 2.0 (the + - "License"); you may not use this file except in compliance + - with the License. You may obtain a copy of the License at + - + - http://www.apache.org/licenses/LICENSE-2.0 + - + - Unless required by applicable law or agreed to in writing, + - software distributed under the License is distributed on an + - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + - KIND, either express or implied. See the License for the + - specific language governing permissions and limitations + - under the License. + - +--> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> + <head> + <title>1.3. A Simple Messaging Program in .NET C# - Apache Qpid™</title> + <meta http-equiv="X-UA-Compatible" content="IE=edge"/> + <meta name="viewport" content="width=device-width, initial-scale=1.0"/> + <link rel="stylesheet" href="/site.css" type="text/css" async="async"/> + <link rel="stylesheet" href="/deferred.css" type="text/css" defer="defer"/> + <script type="text/javascript">var _deferredFunctions = [];</script> + <script type="text/javascript" src="/deferred.js" defer="defer"></script> + <!--[if lte IE 8]> + <link rel="stylesheet" href="/ie.css" type="text/css"/> + <script type="text/javascript" src="/html5shiv.js"></script> + <![endif]--> + + <!-- Redirects for `go get` and godoc.org --> + <meta name="go-import" + content="qpid.apache.org git https://git-wip-us.apache.org/repos/asf/qpid-proton.git"/> + <meta name="go-source" + content="qpid.apache.org +https://github.com/apache/qpid-proton/blob/go1/README.md +https://github.com/apache/qpid-proton/tree/go1{/dir} +https://github.com/apache/qpid-proton/blob/go1{/dir}/{file}#L{line}"/> + </head> + <body> + <div id="-content"> + <div id="-top" class="panel"> + <a id="-menu-link"><img width="16" height="16" src="" alt="Menu"/></a> + + <a id="-search-link"><img width="22" height="16" src="" alt="Search"/></a> + + <ul id="-global-navigation"> + <li><a id="-logotype" href="/index.html">Apache Qpid<sup>™</sup></a></li> + <li><a href="/documentation.html">Documentation</a></li> + <li><a href="/download.html">Download</a></li> + <li><a href="/discussion.html">Discussion</a></li> + </ul> + </div> + + <div id="-menu" class="panel" style="display: none;"> + <div class="flex"> + <section> + <h3>Project</h3> + + <ul> + <li><a href="/overview.html">Overview</a></li> + <li><a href="/components/index.html">Components</a></li> + <li><a href="/releases/index.html">Releases</a></li> + </ul> + </section> + + <section> + <h3>Messaging APIs</h3> + + <ul> + <li><a href="/proton/index.html">Qpid Proton</a></li> + <li><a href="/components/jms/index.html">Qpid JMS</a></li> + <li><a href="/components/messaging-api/index.html">Qpid Messaging API</a></li> + </ul> + </section> + + <section> + <h3>Servers and tools</h3> + + <ul> + <li><a href="/components/broker-j/index.html">Broker-J</a></li> + <li><a href="/components/cpp-broker/index.html">C++ broker</a></li> + <li><a href="/components/dispatch-router/index.html">Dispatch router</a></li> + </ul> + </section> + + <section> + <h3>Resources</h3> + + <ul> + <li><a href="/dashboard.html">Dashboard</a></li> + <li><a href="https://cwiki.apache.org/confluence/display/qpid/Index">Wiki</a></li> + <li><a href="/resources.html">More resources</a></li> + </ul> + </section> + </div> + </div> + + <div id="-search" class="panel" style="display: none;"> + <form action="http://www.google.com/search" method="get"> + <input type="hidden" name="sitesearch" value="qpid.apache.org"/> + <input type="text" name="q" maxlength="255" autofocus="autofocus" tabindex="1"/> + <button type="submit">Search</button> + <a href="/search.html">More ways to search</a> + </form> + </div> + + <div id="-middle" class="panel"> + <ul id="-path-navigation"><li><a href="/index.html">Home</a></li><li><a href="/releases/index.html">Releases</a></li><li><a href="/releases/qpid-cpp-1.39.0/index.html">Qpid C++ 1.39.0</a></li><li><a href="/releases/qpid-cpp-1.39.0/messaging-api/book/index.html">Using the Qpid Messaging API</a></li><li>1.3. A Simple Messaging Program in .NET C#</li></ul> + + <div id="-middle-content"> + <div class="docbook"><div class="navheader"><table summary="Navigation header" width="100%"><tr><th align="center" colspan="3">1.3. A Simple Messaging Program in .NET C#</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="ch01s02.html">Prev</a> </td><th align="center" width="60%">Chapter 1. Using the Qpid Messaging API</th><td align="right" width="20%"> <a accesskey="n" href="section-addresses.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="idm140612073669760"></a>1.3. A Simple Messaging Program in .NET C#</h2></div></div></div><p>The following .NET C# + <a class="footnote" href="#ftn.idm140612073668768" id="idm140612073668768"><sup class="footnote">[1]</sup></a> + 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 id="idm140612073667520"></a><p class="title"><strong>Example 1.3. "Hello world!" in .NET C#</strong></p><div class="example-contents"><pre class="programlisting" lang="c++" xml:lang="c++"> + using System; + using Org.Apache.Qpid.Messaging; <a class="co" href="ch01s03.html#callout-csharp-using" id="hello-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" href="ch01s03.html#callout-csharp-open" id="hello-csharp-open">(2)</a> + Session session = connection.CreateSession(); <a class="co" href="ch01s03.html#callout-csharp-session" id="hello-csharp-session">(3)</a> + + Receiver receiver = session.CreateReceiver(address); <a class="co" href="ch01s03.html#callout-csharp-receiver" id="hello-csharp-receiver">(4)</a> + Sender sender = session.CreateSender(address); <a class="co" href="ch01s03.html#callout-csharp-sender" id="hello-csharp-sender">(5)</a> + + sender.Send(new Message("Hello world!")); + + Message message = new Message(); + message = receiver.Fetch(DurationConstants.SECOND * 1); <a class="co" href="ch01s03.html#callout-csharp-fetch" id="hello-csharp-fetch">(6)</a> + Console.WriteLine("{0}", message.GetContent()); + session.Acknowledge(); <a class="co" href="ch01s03.html#callout-csharp-acknowledge" id="hello-csharp-acknowledge">(7)</a> + + connection.Close(); <a class="co" href="ch01s03.html#callout-csharp-close" id="hello-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 align="left" valign="top" width="5%"><p><a id="callout-csharp-using"></a><a href="#hello-csharp-using">(1)</a> </p></td><td align="left" valign="top"><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 align="left" valign="top" width="5%"><p><a id="callout-csharp-open"></a><a href="#hello-csharp-open">(2)</a> </p></td><td align="left" valign="top"><p>Establishes the connection with the messaging broker.</p></td></tr><tr><td align="left" valign="top" width="5%"><p><a id="callout-csharp-session"></a><a href="#hello-csharp-session">(3)</a> </p></td><td align="left" valign="top"><p>Creates a session object on which messages wi ll be sent and received.</p></td></tr><tr><td align="left" valign="top" width="5%"><p><a id="callout-csharp-receiver"></a><a href="#hello-csharp-receiver">(4)</a> </p></td><td align="left" valign="top"><p>Creates a receiver that receives messages from the given address.</p></td></tr><tr><td align="left" valign="top" width="5%"><p><a id="callout-csharp-sender"></a><a href="#hello-csharp-sender">(5)</a> </p></td><td align="left" valign="top"><p>Creates a sender that sends to the given address.</p></td></tr><tr><td align="left" valign="top" width="5%"><p><a id="callout-csharp-fetch"></a><a href="#hello-csharp-fetch">(6)</a> </p></td><td align="left" valign="top"><p>Receives the next message. The duration is optional, if omitted, will wait indefinitely for the next message.</p></td></tr><tr><td align="left" valign="top" width="5%"><p><a id="callout-csharp-acknowledge"></a><a href="#hello-csharp-acknowledge">(7)</a> </p></td><td align="left" valign="top"><p>Acknowledges receipt of all fe tched messages on the + session. This informs the broker that the messages were + transfered and processed by the client successfully.</p></td></tr><tr><td align="left" valign="top" width="5%"><p><a id="callout-csharp-close"></a><a href="#hello-csharp-close">(8)</a> </p></td><td align="left" valign="top"><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 align="left" width="100" /><div class="footnote" id="ftn.idm140612073668768"><p><a class="para" href="#idm140612073668768"><sup class="para">[1] </sup></a> + 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 class="navfooter"><hr /><table summary="Navigation footer" width="100%"><tr><td align="left" width="40%"><a accesskey="p" href="ch01s02.html">Prev</a> </td><td align="center" width="20%"><a accesskey="u" href="using-the-qpid-messaging-api.html">Up</a></td><td align="right" width="40%"> <a accesskey="n" href="section-addresses.html">Next</a></td></tr><tr><td align="left" valign="top" width="40%">1.2. A Simple Messaging Program in Python </td><td align="center" width="20%"><a accesskey="h" href="index.html">Home</a></td><td align="right" valign="top" width="40%"> 1.4. Addresses</td></tr></table></div></div> + + <hr/> + + <ul id="-apache-navigation"> + <li><a href="http://www.apache.org/">Apache</a></li> + <li><a href="http://www.apache.org/licenses/">License</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="/security.html">Security</a></li> + <li><a href="http://www.apache.org/"><img id="-apache-feather" width="48" height="14" src="" alt="Apache"/></a></li> + </ul> + + <p id="-legal"> + Apache Qpid, Messaging built on AMQP; Copyright © 2015 + The Apache Software Foundation; Licensed under + the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache + License, Version 2.0</a>; Apache Qpid, Qpid, Qpid Proton, + Proton, Apache, the Apache feather logo, and the Apache Qpid + project logo are trademarks of The Apache Software + Foundation; All other marks mentioned may be trademarks or + registered trademarks of their respective owners + </p> + </div> + </div> + </div> + </body> +</html> http://git-wip-us.apache.org/repos/asf/qpid-site/blob/c3ab60f6/content/releases/qpid-cpp-1.39.0/messaging-api/book/ch01s08.html ---------------------------------------------------------------------- diff --git a/content/releases/qpid-cpp-1.39.0/messaging-api/book/ch01s08.html b/content/releases/qpid-cpp-1.39.0/messaging-api/book/ch01s08.html new file mode 100644 index 0000000..83d1e03 --- /dev/null +++ b/content/releases/qpid-cpp-1.39.0/messaging-api/book/ch01s08.html @@ -0,0 +1,180 @@ +<!DOCTYPE html> +<!-- + - + - Licensed to the Apache Software Foundation (ASF) under one + - or more contributor license agreements. See the NOTICE file + - distributed with this work for additional information + - regarding copyright ownership. The ASF licenses this file + - to you under the Apache License, Version 2.0 (the + - "License"); you may not use this file except in compliance + - with the License. You may obtain a copy of the License at + - + - http://www.apache.org/licenses/LICENSE-2.0 + - + - Unless required by applicable law or agreed to in writing, + - software distributed under the License is distributed on an + - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + - KIND, either express or implied. See the License for the + - specific language governing permissions and limitations + - under the License. + - +--> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> + <head> + <title>1.8. Receiving Messages from Multiple Sources - Apache Qpid™</title> + <meta http-equiv="X-UA-Compatible" content="IE=edge"/> + <meta name="viewport" content="width=device-width, initial-scale=1.0"/> + <link rel="stylesheet" href="/site.css" type="text/css" async="async"/> + <link rel="stylesheet" href="/deferred.css" type="text/css" defer="defer"/> + <script type="text/javascript">var _deferredFunctions = [];</script> + <script type="text/javascript" src="/deferred.js" defer="defer"></script> + <!--[if lte IE 8]> + <link rel="stylesheet" href="/ie.css" type="text/css"/> + <script type="text/javascript" src="/html5shiv.js"></script> + <![endif]--> + + <!-- Redirects for `go get` and godoc.org --> + <meta name="go-import" + content="qpid.apache.org git https://git-wip-us.apache.org/repos/asf/qpid-proton.git"/> + <meta name="go-source" + content="qpid.apache.org +https://github.com/apache/qpid-proton/blob/go1/README.md +https://github.com/apache/qpid-proton/tree/go1{/dir} +https://github.com/apache/qpid-proton/blob/go1{/dir}/{file}#L{line}"/> + </head> + <body> + <div id="-content"> + <div id="-top" class="panel"> + <a id="-menu-link"><img width="16" height="16" src="" alt="Menu"/></a> + + <a id="-search-link"><img width="22" height="16" src="" alt="Search"/></a> + + <ul id="-global-navigation"> + <li><a id="-logotype" href="/index.html">Apache Qpid<sup>™</sup></a></li> + <li><a href="/documentation.html">Documentation</a></li> + <li><a href="/download.html">Download</a></li> + <li><a href="/discussion.html">Discussion</a></li> + </ul> + </div> + + <div id="-menu" class="panel" style="display: none;"> + <div class="flex"> + <section> + <h3>Project</h3> + + <ul> + <li><a href="/overview.html">Overview</a></li> + <li><a href="/components/index.html">Components</a></li> + <li><a href="/releases/index.html">Releases</a></li> + </ul> + </section> + + <section> + <h3>Messaging APIs</h3> + + <ul> + <li><a href="/proton/index.html">Qpid Proton</a></li> + <li><a href="/components/jms/index.html">Qpid JMS</a></li> + <li><a href="/components/messaging-api/index.html">Qpid Messaging API</a></li> + </ul> + </section> + + <section> + <h3>Servers and tools</h3> + + <ul> + <li><a href="/components/broker-j/index.html">Broker-J</a></li> + <li><a href="/components/cpp-broker/index.html">C++ broker</a></li> + <li><a href="/components/dispatch-router/index.html">Dispatch router</a></li> + </ul> + </section> + + <section> + <h3>Resources</h3> + + <ul> + <li><a href="/dashboard.html">Dashboard</a></li> + <li><a href="https://cwiki.apache.org/confluence/display/qpid/Index">Wiki</a></li> + <li><a href="/resources.html">More resources</a></li> + </ul> + </section> + </div> + </div> + + <div id="-search" class="panel" style="display: none;"> + <form action="http://www.google.com/search" method="get"> + <input type="hidden" name="sitesearch" value="qpid.apache.org"/> + <input type="text" name="q" maxlength="255" autofocus="autofocus" tabindex="1"/> + <button type="submit">Search</button> + <a href="/search.html">More ways to search</a> + </form> + </div> + + <div id="-middle" class="panel"> + <ul id="-path-navigation"><li><a href="/index.html">Home</a></li><li><a href="/releases/index.html">Releases</a></li><li><a href="/releases/qpid-cpp-1.39.0/index.html">Qpid C++ 1.39.0</a></li><li><a href="/releases/qpid-cpp-1.39.0/messaging-api/book/index.html">Using the Qpid Messaging API</a></li><li>1.8. Receiving Messages from Multiple Sources</li></ul> + + <div id="-middle-content"> + <div class="docbook"><div class="navheader"><table summary="Navigation header" width="100%"><tr><th align="center" colspan="3">1.8. Receiving Messages from Multiple Sources</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="acknowledgements.html">Prev</a> </td><th align="center" width="60%">Chapter 1. Using the Qpid Messaging API</th><td align="right" width="20%"> <a accesskey="n" href="ch01s09.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="idm140612067926880"></a>1.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="1.6. Receiver Capacity (Prefetch)">Section 1.6, “Receiver Capacity (Prefetch)”</a> for more on this.</p><div class="example"><a id="idm140612067924000"></a><p class="title"><strong>Example 1.12. Receiving Messages from Multiple Sources</strong></p><div class="example-contents"><p>C++:</p><pre class="programlisting"> + Receiver receiver1 = session.createReceiver(address1); + receiver1.setCapacity(10); + Receiver receiver2 = session.createReceiver(address2); + receiver2.setCapacity(10); + + Message message = session.nextReceiver().fetch(); + std::cout << message.getContent() << std::endl; + session.acknowledge(); // acknowledge message receipt + </pre><p>Python:</p><pre class="programlisting"> + receiver1 = session.receiver(address1) + receiver1.capacity = 10 + receiver2 = session.receiver(address) + receiver2.capacity = 10 + message = session.next_receiver().fetch() + print message.content + session.acknowledge() + </pre><p>.NET C#:</p><pre class="programlisting"> + Receiver receiver1 = session.CreateReceiver(address1); + receiver1.Capacity = 10; + Receiver receiver2 = session.CreateReceiver(address2); + receiver2.Capacity = 10; + + Message message = new Message(); + message = session.NextReceiver().Fetch(); + Console.WriteLine("{0}", message.GetContent()); + session.Acknowledge(); + </pre></div></div><br class="example-break" /></div><div class="navfooter"><hr /><table summary="Navigation footer" width="100%"><tr><td align="left" width="40%"><a accesskey="p" href="acknowledgements.html">Prev</a> </td><td align="center" width="20%"><a accesskey="u" href="using-the-qpid-messaging-api.html">Up</a></td><td align="right" width="40%"> <a accesskey="n" href="ch01s09.html">Next</a></td></tr><tr><td align="left" valign="top" width="40%">1.7. Acknowledging Received Messages </td><td align="center" width="20%"><a accesskey="h" href="index.html">Home</a></td><td align="right" valign="top" width="40%"> 1.9. Transactions</td></tr></table></div></div> + + <hr/> + + <ul id="-apache-navigation"> + <li><a href="http://www.apache.org/">Apache</a></li> + <li><a href="http://www.apache.org/licenses/">License</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="/security.html">Security</a></li> + <li><a href="http://www.apache.org/"><img id="-apache-feather" width="48" height="14" src="" alt="Apache"/></a></li> + </ul> + + <p id="-legal"> + Apache Qpid, Messaging built on AMQP; Copyright © 2015 + The Apache Software Foundation; Licensed under + the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache + License, Version 2.0</a>; Apache Qpid, Qpid, Qpid Proton, + Proton, Apache, the Apache feather logo, and the Apache Qpid + project logo are trademarks of The Apache Software + Foundation; All other marks mentioned may be trademarks or + registered trademarks of their respective owners + </p> + </div> + </div> + </div> + </body> +</html> http://git-wip-us.apache.org/repos/asf/qpid-site/blob/c3ab60f6/content/releases/qpid-cpp-1.39.0/messaging-api/book/ch01s09.html ---------------------------------------------------------------------- diff --git a/content/releases/qpid-cpp-1.39.0/messaging-api/book/ch01s09.html b/content/releases/qpid-cpp-1.39.0/messaging-api/book/ch01s09.html new file mode 100644 index 0000000..c701384 --- /dev/null +++ b/content/releases/qpid-cpp-1.39.0/messaging-api/book/ch01s09.html @@ -0,0 +1,176 @@ +<!DOCTYPE html> +<!-- + - + - Licensed to the Apache Software Foundation (ASF) under one + - or more contributor license agreements. See the NOTICE file + - distributed with this work for additional information + - regarding copyright ownership. The ASF licenses this file + - to you under the Apache License, Version 2.0 (the + - "License"); you may not use this file except in compliance + - with the License. You may obtain a copy of the License at + - + - http://www.apache.org/licenses/LICENSE-2.0 + - + - Unless required by applicable law or agreed to in writing, + - software distributed under the License is distributed on an + - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + - KIND, either express or implied. See the License for the + - specific language governing permissions and limitations + - under the License. + - +--> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> + <head> + <title>1.9. Transactions - Apache Qpid™</title> + <meta http-equiv="X-UA-Compatible" content="IE=edge"/> + <meta name="viewport" content="width=device-width, initial-scale=1.0"/> + <link rel="stylesheet" href="/site.css" type="text/css" async="async"/> + <link rel="stylesheet" href="/deferred.css" type="text/css" defer="defer"/> + <script type="text/javascript">var _deferredFunctions = [];</script> + <script type="text/javascript" src="/deferred.js" defer="defer"></script> + <!--[if lte IE 8]> + <link rel="stylesheet" href="/ie.css" type="text/css"/> + <script type="text/javascript" src="/html5shiv.js"></script> + <![endif]--> + + <!-- Redirects for `go get` and godoc.org --> + <meta name="go-import" + content="qpid.apache.org git https://git-wip-us.apache.org/repos/asf/qpid-proton.git"/> + <meta name="go-source" + content="qpid.apache.org +https://github.com/apache/qpid-proton/blob/go1/README.md +https://github.com/apache/qpid-proton/tree/go1{/dir} +https://github.com/apache/qpid-proton/blob/go1{/dir}/{file}#L{line}"/> + </head> + <body> + <div id="-content"> + <div id="-top" class="panel"> + <a id="-menu-link"><img width="16" height="16" src="" alt="Menu"/></a> + + <a id="-search-link"><img width="22" height="16" src="" alt="Search"/></a> + + <ul id="-global-navigation"> + <li><a id="-logotype" href="/index.html">Apache Qpid<sup>™</sup></a></li> + <li><a href="/documentation.html">Documentation</a></li> + <li><a href="/download.html">Download</a></li> + <li><a href="/discussion.html">Discussion</a></li> + </ul> + </div> + + <div id="-menu" class="panel" style="display: none;"> + <div class="flex"> + <section> + <h3>Project</h3> + + <ul> + <li><a href="/overview.html">Overview</a></li> + <li><a href="/components/index.html">Components</a></li> + <li><a href="/releases/index.html">Releases</a></li> + </ul> + </section> + + <section> + <h3>Messaging APIs</h3> + + <ul> + <li><a href="/proton/index.html">Qpid Proton</a></li> + <li><a href="/components/jms/index.html">Qpid JMS</a></li> + <li><a href="/components/messaging-api/index.html">Qpid Messaging API</a></li> + </ul> + </section> + + <section> + <h3>Servers and tools</h3> + + <ul> + <li><a href="/components/broker-j/index.html">Broker-J</a></li> + <li><a href="/components/cpp-broker/index.html">C++ broker</a></li> + <li><a href="/components/dispatch-router/index.html">Dispatch router</a></li> + </ul> + </section> + + <section> + <h3>Resources</h3> + + <ul> + <li><a href="/dashboard.html">Dashboard</a></li> + <li><a href="https://cwiki.apache.org/confluence/display/qpid/Index">Wiki</a></li> + <li><a href="/resources.html">More resources</a></li> + </ul> + </section> + </div> + </div> + + <div id="-search" class="panel" style="display: none;"> + <form action="http://www.google.com/search" method="get"> + <input type="hidden" name="sitesearch" value="qpid.apache.org"/> + <input type="text" name="q" maxlength="255" autofocus="autofocus" tabindex="1"/> + <button type="submit">Search</button> + <a href="/search.html">More ways to search</a> + </form> + </div> + + <div id="-middle" class="panel"> + <ul id="-path-navigation"><li><a href="/index.html">Home</a></li><li><a href="/releases/index.html">Releases</a></li><li><a href="/releases/qpid-cpp-1.39.0/index.html">Qpid C++ 1.39.0</a></li><li><a href="/releases/qpid-cpp-1.39.0/messaging-api/book/index.html">Using the Qpid Messaging API</a></li><li>1.9. Transactions</li></ul> + + <div id="-middle-content"> + <div class="docbook"><div class="navheader"><table summary="Navigation header" width="100%"><tr><th align="center" colspan="3">1.9. Transactions</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="ch01s08.html">Prev</a> </td><th align="center" width="60%">Chapter 1. Using the Qpid Messaging API</th><td align="right" width="20%"> <a accesskey="n" href="connections.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="idm140612067918192"></a>1.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 + + <a class="footnote" href="#ftn.idm140612067916864" id="idm140612067916864"><sup class="footnote">[8]</sup></a> + + .</p><div class="example"><a id="idm140612067915952"></a><p class="title"><strong>Example 1.13. Transactions</strong></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 align="left" width="100" /><div class="footnote" id="ftn.idm140612067916864"><p><a class="para" href="#idm140612067916864"><sup class="para">[8] </sup></a>Note that this currently is only true for + messages received using a reliable mode + e.g. at-least-once. Messages sent by a broker to a receiver in + unreliable receiver will be discarded immediately regardless of + transctionality.</p></div></div></div><div class="navfooter"><hr /><table summary="Navigation footer" width="100%"><tr><td align="left" width="40%"><a accesskey="p" href="ch01s08.html">Prev</a> </td><td align="center" width="20%"><a accesskey="u" href="using-the-qpid-messaging-api.html">Up</a></td><td align="right" width="40%"> <a accesskey="n" href="connections.html">Next</a></td></tr><tr><td align="left" valign="top" width="40%">1.8. Receiving Messages from Multiple Sources </td><td align="center" width="20%"><a accesskey="h" href="index.html">Home</a></td><td align="right" valign="top" width="40%"> 1.10. Connections</td></tr></table></div></div> + + <hr/> + + <ul id="-apache-navigation"> + <li><a href="http://www.apache.org/">Apache</a></li> + <li><a href="http://www.apache.org/licenses/">License</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="/security.html">Security</a></li> + <li><a href="http://www.apache.org/"><img id="-apache-feather" width="48" height="14" src="" alt="Apache"/></a></li> + </ul> + + <p id="-legal"> + Apache Qpid, Messaging built on AMQP; Copyright © 2015 + The Apache Software Foundation; Licensed under + the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache + License, Version 2.0</a>; Apache Qpid, Qpid, Qpid Proton, + Proton, Apache, the Apache feather logo, and the Apache Qpid + project logo are trademarks of The Apache Software + Foundation; All other marks mentioned may be trademarks or + registered trademarks of their respective owners + </p> + </div> + </div> + </div> + </body> +</html> http://git-wip-us.apache.org/repos/asf/qpid-site/blob/c3ab60f6/content/releases/qpid-cpp-1.39.0/messaging-api/book/ch01s12.html ---------------------------------------------------------------------- diff --git a/content/releases/qpid-cpp-1.39.0/messaging-api/book/ch01s12.html b/content/releases/qpid-cpp-1.39.0/messaging-api/book/ch01s12.html new file mode 100644 index 0000000..9608fc9 --- /dev/null +++ b/content/releases/qpid-cpp-1.39.0/messaging-api/book/ch01s12.html @@ -0,0 +1,185 @@ +<!DOCTYPE html> +<!-- + - + - Licensed to the Apache Software Foundation (ASF) under one + - or more contributor license agreements. See the NOTICE file + - distributed with this work for additional information + - regarding copyright ownership. The ASF licenses this file + - to you under the Apache License, Version 2.0 (the + - "License"); you may not use this file except in compliance + - with the License. You may obtain a copy of the License at + - + - http://www.apache.org/licenses/LICENSE-2.0 + - + - Unless required by applicable law or agreed to in writing, + - software distributed under the License is distributed on an + - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + - KIND, either express or implied. See the License for the + - specific language governing permissions and limitations + - under the License. + - +--> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> + <head> + <title>1.12. The Request / Response Pattern - Apache Qpid™</title> + <meta http-equiv="X-UA-Compatible" content="IE=edge"/> + <meta name="viewport" content="width=device-width, initial-scale=1.0"/> + <link rel="stylesheet" href="/site.css" type="text/css" async="async"/> + <link rel="stylesheet" href="/deferred.css" type="text/css" defer="defer"/> + <script type="text/javascript">var _deferredFunctions = [];</script> + <script type="text/javascript" src="/deferred.js" defer="defer"></script> + <!--[if lte IE 8]> + <link rel="stylesheet" href="/ie.css" type="text/css"/> + <script type="text/javascript" src="/html5shiv.js"></script> + <![endif]--> + + <!-- Redirects for `go get` and godoc.org --> + <meta name="go-import" + content="qpid.apache.org git https://git-wip-us.apache.org/repos/asf/qpid-proton.git"/> + <meta name="go-source" + content="qpid.apache.org +https://github.com/apache/qpid-proton/blob/go1/README.md +https://github.com/apache/qpid-proton/tree/go1{/dir} +https://github.com/apache/qpid-proton/blob/go1{/dir}/{file}#L{line}"/> + </head> + <body> + <div id="-content"> + <div id="-top" class="panel"> + <a id="-menu-link"><img width="16" height="16" src="" alt="Menu"/></a> + + <a id="-search-link"><img width="22" height="16" src="" alt="Search"/></a> + + <ul id="-global-navigation"> + <li><a id="-logotype" href="/index.html">Apache Qpid<sup>™</sup></a></li> + <li><a href="/documentation.html">Documentation</a></li> + <li><a href="/download.html">Download</a></li> + <li><a href="/discussion.html">Discussion</a></li> + </ul> + </div> + + <div id="-menu" class="panel" style="display: none;"> + <div class="flex"> + <section> + <h3>Project</h3> + + <ul> + <li><a href="/overview.html">Overview</a></li> + <li><a href="/components/index.html">Components</a></li> + <li><a href="/releases/index.html">Releases</a></li> + </ul> + </section> + + <section> + <h3>Messaging APIs</h3> + + <ul> + <li><a href="/proton/index.html">Qpid Proton</a></li> + <li><a href="/components/jms/index.html">Qpid JMS</a></li> + <li><a href="/components/messaging-api/index.html">Qpid Messaging API</a></li> + </ul> + </section> + + <section> + <h3>Servers and tools</h3> + + <ul> + <li><a href="/components/broker-j/index.html">Broker-J</a></li> + <li><a href="/components/cpp-broker/index.html">C++ broker</a></li> + <li><a href="/components/dispatch-router/index.html">Dispatch router</a></li> + </ul> + </section> + + <section> + <h3>Resources</h3> + + <ul> + <li><a href="/dashboard.html">Dashboard</a></li> + <li><a href="https://cwiki.apache.org/confluence/display/qpid/Index">Wiki</a></li> + <li><a href="/resources.html">More resources</a></li> + </ul> + </section> + </div> + </div> + + <div id="-search" class="panel" style="display: none;"> + <form action="http://www.google.com/search" method="get"> + <input type="hidden" name="sitesearch" value="qpid.apache.org"/> + <input type="text" name="q" maxlength="255" autofocus="autofocus" tabindex="1"/> + <button type="submit">Search</button> + <a href="/search.html">More ways to search</a> + </form> + </div> + + <div id="-middle" class="panel"> + <ul id="-path-navigation"><li><a href="/index.html">Home</a></li><li><a href="/releases/index.html">Releases</a></li><li><a href="/releases/qpid-cpp-1.39.0/index.html">Qpid C++ 1.39.0</a></li><li><a href="/releases/qpid-cpp-1.39.0/messaging-api/book/index.html">Using the Qpid Messaging API</a></li><li>1.12. The Request / Response Pattern</li></ul> + + <div id="-middle-content"> + <div class="docbook"><div class="navheader"><table summary="Navigation header" width="100%"><tr><th align="center" colspan="3">1.12. The Request / Response Pattern</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="section-Maps.html">Prev</a> </td><th align="center" width="60%">Chapter 1. Using the Qpid Messaging API</th><td align="right" width="20%"> <a accesskey="n" href="ch01s13.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="idm140612067760944"></a>1.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 1.9. Mapping to AMQP 0-10 Message Properties">Table 1.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 id="idm140612067758816"></a><p class="title"><strong>Example 1.18. Request / Response Applications in C++</strong></p><div class="example-contents"><p>This example shows the C++ code for a client and server + that use the request / response pattern.</p><p>The server creates a service queue and waits for a + message to arrive. If it receives a message, it sends a + message back to the sender.</p><pre class="programlisting">Receiver receiver = session.createReceiver("service_queue; {create: always}"); + + Message request = receiver.fetch(); + const Address&amp; address = request.getReplyTo(); // Get "reply-to" from request ... + if (address) { + Sender sender = session.createSender(address); // ... send response to "reply-to" + Message response("pong!"); + sender.send(response); + session.acknowledge(); + } + </pre><p>The client creates a sender for the service queue, and + also creates a response queue that is deleted when the + client closes the receiver for the response queue. In the C++ + client, if the address starts with the character + <code class="literal">#</code>, it is given a unique name.</p><pre class="programlisting"> + Sender sender = session.createSender("service_queue"); + + Address responseQueue("#response-queue; {create:always, delete:always}"); + Receiver receiver = session.createReceiver(responseQueue); + + Message request; + request.setReplyTo(responseQueue); + request.setContent("ping"); + sender.send(request); + Message response = receiver.fetch(); + std::cout << request.getContent() << " -> " << response.getContent() << std::endl; + </pre><p>The client sends the string <code class="literal">ping</code> to + the server. The server sends the response + <code class="literal">pong</code> back to the same client, using the + <code class="varname">replyTo</code> property.</p></div></div><br class="example-break" /></div><div class="navfooter"><hr /><table summary="Navigation footer" width="100%"><tr><td align="left" width="40%"><a accesskey="p" href="section-Maps.html">Prev</a> </td><td align="center" width="20%"><a accesskey="u" href="using-the-qpid-messaging-api.html">Up</a></td><td align="right" width="40%"> <a accesskey="n" href="ch01s13.html">Next</a></td></tr><tr><td align="left" valign="top" width="40%">1.11. Maps and Lists in Message Content </td><td align="center" width="20%"><a accesskey="h" href="index.html">Home</a></td><td align="right" valign="top" width="40%"> 1.13. Performance Tips</td></tr></table></div></div> + + <hr/> + + <ul id="-apache-navigation"> + <li><a href="http://www.apache.org/">Apache</a></li> + <li><a href="http://www.apache.org/licenses/">License</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="/security.html">Security</a></li> + <li><a href="http://www.apache.org/"><img id="-apache-feather" width="48" height="14" src="" alt="Apache"/></a></li> + </ul> + + <p id="-legal"> + Apache Qpid, Messaging built on AMQP; Copyright © 2015 + The Apache Software Foundation; Licensed under + the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache + License, Version 2.0</a>; Apache Qpid, Qpid, Qpid Proton, + Proton, Apache, the Apache feather logo, and the Apache Qpid + project logo are trademarks of The Apache Software + Foundation; All other marks mentioned may be trademarks or + registered trademarks of their respective owners + </p> + </div> + </div> + </div> + </body> +</html> --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
