You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by jr...@apache.org on 2016/09/06 16:59:40 UTC
[17/51] [partial] qpid-site git commit: QPID-7353: Update for the
Qpid C++ 1.35.0 release
http://git-wip-us.apache.org/repos/asf/qpid-site/blob/eff0fe55/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/drain.cpp
----------------------------------------------------------------------
diff --git a/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/drain.cpp b/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/drain.cpp
new file mode 100755
index 0000000..0c58cc2
--- /dev/null
+++ b/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/drain.cpp
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+#include <qpid/messaging/Connection.h>
+#include <qpid/messaging/Message.h>
+#include <qpid/messaging/Message_io.h>
+#include <qpid/messaging/Receiver.h>
+#include <qpid/messaging/Session.h>
+
+#include <iostream>
+
+#include "OptionParser.h"
+
+using namespace qpid::messaging;
+using namespace qpid::types;
+
+struct Options : OptionParser
+{
+ std::string url;
+ std::string address;
+ std::string connectionOptions;
+ int timeout;
+ bool forever;
+ int count;
+
+ Options()
+ : OptionParser("Usage: drain [OPTIONS] ADDRESS", "Drains messages from the specified address"),
+ url("127.0.0.1"),
+ timeout(0),
+ forever(false),
+ count(0)
+ {
+ add("broker,b", url, "url of broker to connect to");
+ add("timeout,t", timeout, "timeout in seconds to wait before exiting");
+ add("forever,f", forever, "ignore timeout and wait forever");
+ add("connection-options", connectionOptions, "connection options string in the form {name1:value1, name2:value2}");
+ add("count,c", count, "number of messages to read before exiting");
+ }
+
+ Duration getTimeout()
+ {
+ if (forever) return Duration::FOREVER;
+ else return timeout*Duration::SECOND;
+ }
+
+ int getCount()
+ {
+ return count;
+ }
+
+ bool checkAddress()
+ {
+ if (getArguments().empty()) {
+ error("Address is required");
+ return false;
+ } else {
+ address = getArguments()[0];
+ return true;
+ }
+ }
+};
+
+int main(int argc, char** argv)
+{
+ Options options;
+ if (options.parse(argc, argv) && options.checkAddress()) {
+ Connection connection;
+ try {
+ connection = Connection(options.url, options.connectionOptions);
+ connection.open();
+ Session session = connection.createSession();
+ Receiver receiver = session.createReceiver(options.address);
+ Duration timeout = options.getTimeout();
+ int count = options.getCount();
+ Message message;
+ int i = 0;
+
+ while (receiver.fetch(message, timeout)) {
+ std::cout << message << std::endl;
+ session.acknowledge();
+ if (count && (++i == count))
+ break;
+ }
+ receiver.close();
+ session.close();
+ connection.close();
+ return 0;
+ } catch(const std::exception& error) {
+ std::cout << "Error: " << error.what() << std::endl;
+ connection.close();
+ }
+ }
+ return 1;
+}
http://git-wip-us.apache.org/repos/asf/qpid-site/blob/eff0fe55/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/drain.cpp.html
----------------------------------------------------------------------
diff --git a/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/drain.cpp.html b/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/drain.cpp.html
new file mode 100644
index 0000000..3b43b3c
--- /dev/null
+++ b/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/drain.cpp.html
@@ -0,0 +1,240 @@
+<!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>drain.cpp - 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/java-broker/index.html">Broker for Java</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.35.0/index.html">Qpid C++ 1.35.0</a></li><li><a href="/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/index.html">C++ Messaging API Examples</a></li><li>drain.cpp</li></ul>
+
+ <div id="-middle-content">
+
+<h1>drain.cpp</h1>
+<div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><qpid/messaging/Connection.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><qpid/messaging/Message.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><qpid/messaging/Message_io.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><qpid/messaging/Receiver.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><qpid/messaging/Session.h></span><span class="cp"></span>
+
+<span class="cp">#include</span> <span class="cpf"><iostream></span><span class="cp"></span>
+
+<span class="cp">#include</span> <span class="cpf">"OptionParser.h"</span><span class="cp"></span>
+
+<span class="k">using</span> <span class="k">namespace</span> <span class="n">qpid</span><span class="o">::</span><span class="n">messaging</span><span class="p">;</span>
+<span class="k">using</span> <span class="k">namespace</span> <span class="n">qpid</span><span class="o">::</span><span class="n">types</span><span class="p">;</span>
+
+<span class="k">struct</span> <span class="nl">Options</span> <span class="p">:</span> <span class="n">OptionParser</span>
+<span class="p">{</span>
+ <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">url</span><span class="p">;</span>
+ <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">address</span><span class="p">;</span>
+ <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">connectionOptions</span><span class="p">;</span>
+ <span class="kt">int</span> <span class="n">timeout</span><span class="p">;</span>
+ <span class="kt">bool</span> <span class="n">forever</span><span class="p">;</span>
+ <span class="kt">int</span> <span class="n">count</span><span class="p">;</span>
+
+ <span class="n">Options</span><span class="p">()</span>
+ <span class="o">:</span> <span class="n">OptionParser</span><span class="p">(</span><span class="s">"Usage: drain [OPTIONS] ADDRESS"</span><span class="p">,</span> <span class="s">"Drains messages from the specified address"</span><span class="p">),</span>
+ <span class="n">url</span><span class="p">(</span><span class="s">"127.0.0.1"</span><span class="p">),</span>
+ <span class="n">timeout</span><span class="p">(</span><span class="mi">0</span><span class="p">),</span>
+ <span class="n">forever</span><span class="p">(</span><span class="nb">false</span><span class="p">),</span>
+ <span class="n">count</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
+ <span class="p">{</span>
+ <span class="n">add</span><span class="p">(</span><span class="s">"broker,b"</span><span class="p">,</span> <span class="n">url</span><span class="p">,</span> <span class="s">"url of broker to connect to"</span><span class="p">);</span>
+ <span class="n">add</span><span class="p">(</span><span class="s">"timeout,t"</span><span class="p">,</span> <span class="n">timeout</span><span class="p">,</span> <span class="s">"timeout in seconds to wait before exiting"</span><span class="p">);</span>
+ <span class="n">add</span><span class="p">(</span><span class="s">"forever,f"</span><span class="p">,</span> <span class="n">forever</span><span class="p">,</span> <span class="s">"ignore timeout and wait forever"</span><span class="p">);</span>
+ <span class="n">add</span><span class="p">(</span><span class="s">"connection-options"</span><span class="p">,</span> <span class="n">connectionOptions</span><span class="p">,</span> <span class="s">"connection options string in the form {name1:value1, name2:value2}"</span><span class="p">);</span>
+ <span class="n">add</span><span class="p">(</span><span class="s">"count,c"</span><span class="p">,</span> <span class="n">count</span><span class="p">,</span> <span class="s">"number of messages to read before exiting"</span><span class="p">);</span>
+ <span class="p">}</span>
+
+ <span class="n">Duration</span> <span class="n">getTimeout</span><span class="p">()</span>
+ <span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">forever</span><span class="p">)</span> <span class="k">return</span> <span class="n">Duration</span><span class="o">::</span><span class="n">FOREVER</span><span class="p">;</span>
+ <span class="k">else</span> <span class="k">return</span> <span class="n">timeout</span><span class="o">*</span><span class="n">Duration</span><span class="o">::</span><span class="n">SECOND</span><span class="p">;</span>
+ <span class="p">}</span>
+
+ <span class="kt">int</span> <span class="n">getCount</span><span class="p">()</span>
+ <span class="p">{</span>
+ <span class="k">return</span> <span class="n">count</span><span class="p">;</span>
+ <span class="p">}</span>
+
+ <span class="kt">bool</span> <span class="n">checkAddress</span><span class="p">()</span>
+ <span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">getArguments</span><span class="p">().</span><span class="n">empty</span><span class="p">())</span> <span class="p">{</span>
+ <span class="n">error</span><span class="p">(</span><span class="s">"Address is required"</span><span class="p">);</span>
+ <span class="k">return</span> <span class="nb">false</span><span class="p">;</span>
+ <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+ <span class="n">address</span> <span class="o">=</span> <span class="n">getArguments</span><span class="p">()[</span><span class="mi">0</span><span class="p">];</span>
+ <span class="k">return</span> <span class="nb">true</span><span class="p">;</span>
+ <span class="p">}</span>
+ <span class="p">}</span>
+<span class="p">};</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span><span class="o">**</span> <span class="n">argv</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="n">Options</span> <span class="n">options</span><span class="p">;</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">options</span><span class="p">.</span><span class="n">parse</span><span class="p">(</span><span class="n">argc</span><span class="p">,</span> <span class="n">argv</span><span class="p">)</span> <span class="o">&&</span> <span class="n">options</span><span class="p">.</span><span class="n">checkAddress</span><span class="p">())</span> <span class="p">{</span>
+ <span class="n">Connection</span> <span class="n">connection</span><span class="p">;</span>
+ <span class="k">try</span> <span class="p">{</span>
+ <span class="n">connection</span> <span class="o">=</span> <span class="n">Connection</span><span class="p">(</span><span class="n">options</span><span class="p">.</span><span class="n">url</span><span class="p">,</span> <span class="n">options</span><span class="p">.</span><span class="n">connectionOptions</span><span class="p">);</span>
+ <span class="n">connection</span><span class="p">.</span><span class="n">open</span><span class="p">();</span>
+ <span class="n">Session</span> <span class="n">session</span> <span class="o">=</span> <span class="n">connection</span><span class="p">.</span><span class="n">createSession</span><span class="p">();</span>
+ <span class="n">Receiver</span> <span class="n">receiver</span> <span class="o">=</span> <span class="n">session</span><span class="p">.</span><span class="n">createReceiver</span><span class="p">(</span><span class="n">options</span><span class="p">.</span><span class="n">address</span><span class="p">);</span>
+ <span class="n">Duration</span> <span class="n">timeout</span> <span class="o">=</span> <span class="n">options</span><span class="p">.</span><span class="n">getTimeout</span><span class="p">();</span>
+ <span class="kt">int</span> <span class="n">count</span> <span class="o">=</span> <span class="n">options</span><span class="p">.</span><span class="n">getCount</span><span class="p">();</span>
+ <span class="n">Message</span> <span class="n">message</span><span class="p">;</span>
+ <span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+
+ <span class="k">while</span> <span class="p">(</span><span class="n">receiver</span><span class="p">.</span><span class="n">fetch</span><span class="p">(</span><span class="n">message</span><span class="p">,</span> <span class="n">timeout</span><span class="p">))</span> <span class="p">{</span>
+ <span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o"><<</span> <span class="n">message</span> <span class="o"><<</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
+ <span class="n">session</span><span class="p">.</span><span class="n">acknowledge</span><span class="p">();</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">count</span> <span class="o">&&</span> <span class="p">(</span><span class="o">++</span><span class="n">i</span> <span class="o">==</span> <span class="n">count</span><span class="p">))</span>
+ <span class="k">break</span><span class="p">;</span>
+ <span class="p">}</span>
+ <span class="n">receiver</span><span class="p">.</span><span class="n">close</span><span class="p">();</span>
+ <span class="n">session</span><span class="p">.</span><span class="n">close</span><span class="p">();</span>
+ <span class="n">connection</span><span class="p">.</span><span class="n">close</span><span class="p">();</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+ <span class="p">}</span> <span class="k">catch</span><span class="p">(</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">exception</span><span class="o">&</span> <span class="n">error</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o"><<</span> <span class="s">"Error: "</span> <span class="o"><<</span> <span class="n">error</span><span class="p">.</span><span class="n">what</span><span class="p">()</span> <span class="o"><<</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
+ <span class="n">connection</span><span class="p">.</span><span class="n">close</span><span class="p">();</span>
+ <span class="p">}</span>
+ <span class="p">}</span>
+ <span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+
+<p><a href="drain.cpp">Download this file</a></p>
+
+
+ <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/eff0fe55/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/hello_world.cpp
----------------------------------------------------------------------
diff --git a/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/hello_world.cpp b/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/hello_world.cpp
new file mode 100755
index 0000000..61894f4
--- /dev/null
+++ b/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/hello_world.cpp
@@ -0,0 +1,60 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+#include <qpid/messaging/Connection.h>
+#include <qpid/messaging/Message.h>
+#include <qpid/messaging/Receiver.h>
+#include <qpid/messaging/Sender.h>
+#include <qpid/messaging/Session.h>
+
+#include <iostream>
+
+using namespace qpid::messaging;
+
+int main(int argc, char** argv) {
+ std::string broker = argc > 1 ? argv[1] : "localhost:5672";
+ std::string address = argc > 2 ? argv[2] : "amq.topic";
+ std::string connectionOptions = argc > 3 ? argv[3] : "";
+
+ try {
+ Connection connection(broker, connectionOptions);
+ connection.open();
+ Session session = connection.createSession();
+
+ Receiver receiver = session.createReceiver(address);
+ Sender sender = session.createSender(address);
+
+ Message message;
+ message.setContentObject("Hello world!");
+ message.getContentObject().setEncoding("utf8");
+ sender.send(message);
+
+ message = receiver.fetch(Duration::SECOND * 1);
+ std::cout << message.getContent() << std::endl;
+ session.acknowledge();
+
+ connection.close();
+ return 0;
+ } catch(const std::exception& error) {
+ std::cerr << error.what() << std::endl;
+ return 1;
+ }
+}
http://git-wip-us.apache.org/repos/asf/qpid-site/blob/eff0fe55/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/hello_world.cpp.html
----------------------------------------------------------------------
diff --git a/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/hello_world.cpp.html b/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/hello_world.cpp.html
new file mode 100644
index 0000000..7651cdd
--- /dev/null
+++ b/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/hello_world.cpp.html
@@ -0,0 +1,188 @@
+<!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>hello_world.cpp - 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/java-broker/index.html">Broker for Java</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.35.0/index.html">Qpid C++ 1.35.0</a></li><li><a href="/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/index.html">C++ Messaging API Examples</a></li><li>hello_world.cpp</li></ul>
+
+ <div id="-middle-content">
+
+<h1>hello_world.cpp</h1>
+<div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><qpid/messaging/Connection.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><qpid/messaging/Message.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><qpid/messaging/Receiver.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><qpid/messaging/Sender.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><qpid/messaging/Session.h></span><span class="cp"></span>
+
+<span class="cp">#include</span> <span class="cpf"><iostream></span><span class="cp"></span>
+
+<span class="k">using</span> <span class="k">namespace</span> <span class="n">qpid</span><span class="o">::</span><span class="n">messaging</span><span class="p">;</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span><span class="o">**</span> <span class="n">argv</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">broker</span> <span class="o">=</span> <span class="n">argc</span> <span class="o">></span> <span class="mi">1</span> <span class="o">?</span> <span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">:</span> <span class="s">"localhost:5672"</span><span class="p">;</span>
+ <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">address</span> <span class="o">=</span> <span class="n">argc</span> <span class="o">></span> <span class="mi">2</span> <span class="o">?</span> <span class="n">argv</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span> <span class="o">:</span> <span class="s">"amq.topic"</span><span class="p">;</span>
+ <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">connectionOptions</span> <span class="o">=</span> <span class="n">argc</span> <span class="o">></span> <span class="mi">3</span> <span class="o">?</span> <span class="n">argv</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span> <span class="o">:</span> <span class="s">""</span><span class="p">;</span>
+
+ <span class="k">try</span> <span class="p">{</span>
+ <span class="n">Connection</span> <span class="n">connection</span><span class="p">(</span><span class="n">broker</span><span class="p">,</span> <span class="n">connectionOptions</span><span class="p">);</span>
+ <span class="n">connection</span><span class="p">.</span><span class="n">open</span><span class="p">();</span>
+ <span class="n">Session</span> <span class="n">session</span> <span class="o">=</span> <span class="n">connection</span><span class="p">.</span><span class="n">createSession</span><span class="p">();</span>
+
+ <span class="n">Receiver</span> <span class="n">receiver</span> <span class="o">=</span> <span class="n">session</span><span class="p">.</span><span class="n">createReceiver</span><span class="p">(</span><span class="n">address</span><span class="p">);</span>
+ <span class="n">Sender</span> <span class="n">sender</span> <span class="o">=</span> <span class="n">session</span><span class="p">.</span><span class="n">createSender</span><span class="p">(</span><span class="n">address</span><span class="p">);</span>
+
+ <span class="n">Message</span> <span class="n">message</span><span class="p">;</span>
+ <span class="n">message</span><span class="p">.</span><span class="n">setContentObject</span><span class="p">(</span><span class="s">"Hello world!"</span><span class="p">);</span>
+ <span class="n">message</span><span class="p">.</span><span class="n">getContentObject</span><span class="p">().</span><span class="n">setEncoding</span><span class="p">(</span><span class="s">"utf8"</span><span class="p">);</span>
+ <span class="n">sender</span><span class="p">.</span><span class="n">send</span><span class="p">(</span><span class="n">message</span><span class="p">);</span>
+
+ <span class="n">message</span> <span class="o">=</span> <span class="n">receiver</span><span class="p">.</span><span class="n">fetch</span><span class="p">(</span><span class="n">Duration</span><span class="o">::</span><span class="n">SECOND</span> <span class="o">*</span> <span class="mi">1</span><span class="p">);</span>
+ <span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o"><<</span> <span class="n">message</span><span class="p">.</span><span class="n">getContent</span><span class="p">()</span> <span class="o"><<</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
+ <span class="n">session</span><span class="p">.</span><span class="n">acknowledge</span><span class="p">();</span>
+
+ <span class="n">connection</span><span class="p">.</span><span class="n">close</span><span class="p">();</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+ <span class="p">}</span> <span class="k">catch</span><span class="p">(</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">exception</span><span class="o">&</span> <span class="n">error</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">std</span><span class="o">::</span><span class="n">cerr</span> <span class="o"><<</span> <span class="n">error</span><span class="p">.</span><span class="n">what</span><span class="p">()</span> <span class="o"><<</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
+ <span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
+ <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+
+<p><a href="hello_world.cpp">Download this file</a></p>
+
+
+ <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/eff0fe55/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/hello_xml.cpp
----------------------------------------------------------------------
diff --git a/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/hello_xml.cpp b/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/hello_xml.cpp
new file mode 100755
index 0000000..00e1b6c
--- /dev/null
+++ b/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/hello_xml.cpp
@@ -0,0 +1,87 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+#include <qpid/messaging/Connection.h>
+#include <qpid/messaging/Message.h>
+#include <qpid/messaging/Receiver.h>
+#include <qpid/messaging/Sender.h>
+#include <qpid/messaging/Session.h>
+
+#include <iostream>
+#include <sstream>
+using std::stringstream;
+
+using namespace qpid::messaging;
+
+int main(int argc, char** argv) {
+ std::string broker = argc > 1 ? argv[1] : "localhost:5672";
+ std::string connectionOptions = argc > 2 ? argv[2] : "";
+
+ std::string query =
+ "let $w := ./weather "
+ "return $w/station = 'Raleigh-Durham International Airport (KRDU)' "
+ " and $w/temperature_f > 50"
+ " and $w/temperature_f - $w/dewpoint > 5"
+ " and $w/wind_speed_mph > 7"
+ " and $w/wind_speed_mph < 20";
+
+ stringstream address;
+
+ address << "xml-exchange; {"
+ " create: always, " // This line and the next are not in docs
+ " node: { type: topic, x-declare: { type: xml } }, " // Added so it works "out of the box"
+ " link: { "
+ " x-bindings: [{ exchange: xml-exchange, key: weather, arguments: { xquery:\""
+ << query
+ << "\"} }] "
+ " } "
+ "}";
+
+ Connection connection(broker, connectionOptions);
+ try {
+ connection.open();
+ Session session = connection.createSession();
+
+ Receiver receiver = session.createReceiver(address.str());
+
+ Message message;
+ message.setContent(
+ "<weather>"
+ "<station>Raleigh-Durham International Airport (KRDU)</station>"
+ "<wind_speed_mph>16</wind_speed_mph>"
+ "<temperature_f>70</temperature_f>"
+ "<dewpoint>35</dewpoint>"
+ "</weather>");
+ Sender sender = session.createSender("xml-exchange/weather");
+ sender.send(message);
+
+ Message response = receiver.fetch();
+
+ std::cout << response.getContent() << std::endl;
+
+ connection.close();
+ return 0;
+ } catch(const std::exception& error) {
+ std::cerr << error.what() << std::endl;
+ connection.close();
+ return 1;
+ }
+}
http://git-wip-us.apache.org/repos/asf/qpid-site/blob/eff0fe55/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/hello_xml.cpp.html
----------------------------------------------------------------------
diff --git a/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/hello_xml.cpp.html b/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/hello_xml.cpp.html
new file mode 100644
index 0000000..b0086ba
--- /dev/null
+++ b/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/hello_xml.cpp.html
@@ -0,0 +1,215 @@
+<!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>hello_xml.cpp - 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/java-broker/index.html">Broker for Java</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.35.0/index.html">Qpid C++ 1.35.0</a></li><li><a href="/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/index.html">C++ Messaging API Examples</a></li><li>hello_xml.cpp</li></ul>
+
+ <div id="-middle-content">
+
+<h1>hello_xml.cpp</h1>
+<div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><qpid/messaging/Connection.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><qpid/messaging/Message.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><qpid/messaging/Receiver.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><qpid/messaging/Sender.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><qpid/messaging/Session.h></span><span class="cp"></span>
+
+<span class="cp">#include</span> <span class="cpf"><iostream></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><sstream></span><span class="cp"></span>
+<span class="k">using</span> <span class="n">std</span><span class="o">::</span><span class="n">stringstream</span><span class="p">;</span>
+
+<span class="k">using</span> <span class="k">namespace</span> <span class="n">qpid</span><span class="o">::</span><span class="n">messaging</span><span class="p">;</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span><span class="o">**</span> <span class="n">argv</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">broker</span> <span class="o">=</span> <span class="n">argc</span> <span class="o">></span> <span class="mi">1</span> <span class="o">?</span> <span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">:</span> <span class="s">"localhost:5672"</span><span class="p">;</span>
+ <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">connectionOptions</span> <span class="o">=</span> <span class="n">argc</span> <span class="o">></span> <span class="mi">2</span> <span class="o">?</span> <span class="n">argv</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span> <span class="o">:</span> <span class="s">""</span><span class="p">;</span>
+
+ <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">query</span> <span class="o">=</span>
+ <span class="s">"let $w := ./weather "</span>
+ <span class="s">"return $w/station = 'Raleigh-Durham International Airport (KRDU)' "</span>
+ <span class="s">" and $w/temperature_f > 50"</span>
+ <span class="s">" and $w/temperature_f - $w/dewpoint > 5"</span>
+ <span class="s">" and $w/wind_speed_mph > 7"</span>
+ <span class="s">" and $w/wind_speed_mph < 20"</span><span class="p">;</span>
+
+ <span class="n">stringstream</span> <span class="n">address</span><span class="p">;</span>
+
+ <span class="n">address</span> <span class="o"><<</span> <span class="s">"xml-exchange; {"</span>
+ <span class="s">" create: always, "</span> <span class="c1">// This line and the next are not in docs</span>
+ <span class="s">" node: { type: topic, x-declare: { type: xml } }, "</span> <span class="c1">// Added so it works "out of the box"</span>
+ <span class="s">" link: { "</span>
+ <span class="s">" x-bindings: [{ exchange: xml-exchange, key: weather, arguments: { xquery:</span><span class="se">\"</span><span class="s">"</span>
+ <span class="o"><<</span> <span class="n">query</span>
+ <span class="o"><<</span> <span class="s">"</span><span class="se">\"</span><span class="s">} }] "</span>
+ <span class="s">" } "</span>
+ <span class="s">"}"</span><span class="p">;</span>
+
+ <span class="n">Connection</span> <span class="n">connection</span><span class="p">(</span><span class="n">broker</span><span class="p">,</span> <span class="n">connectionOptions</span><span class="p">);</span>
+ <span class="k">try</span> <span class="p">{</span>
+ <span class="n">connection</span><span class="p">.</span><span class="n">open</span><span class="p">();</span>
+ <span class="n">Session</span> <span class="n">session</span> <span class="o">=</span> <span class="n">connection</span><span class="p">.</span><span class="n">createSession</span><span class="p">();</span>
+
+ <span class="n">Receiver</span> <span class="n">receiver</span> <span class="o">=</span> <span class="n">session</span><span class="p">.</span><span class="n">createReceiver</span><span class="p">(</span><span class="n">address</span><span class="p">.</span><span class="n">str</span><span class="p">());</span>
+
+ <span class="n">Message</span> <span class="n">message</span><span class="p">;</span>
+ <span class="n">message</span><span class="p">.</span><span class="n">setContent</span><span class="p">(</span>
+ <span class="s">"<weather>"</span>
+ <span class="s">"<station>Raleigh-Durham International Airport (KRDU)</station>"</span>
+ <span class="s">"<wind_speed_mph>16</wind_speed_mph>"</span>
+ <span class="s">"<temperature_f>70</temperature_f>"</span>
+ <span class="s">"<dewpoint>35</dewpoint>"</span>
+ <span class="s">"</weather>"</span><span class="p">);</span>
+ <span class="n">Sender</span> <span class="n">sender</span> <span class="o">=</span> <span class="n">session</span><span class="p">.</span><span class="n">createSender</span><span class="p">(</span><span class="s">"xml-exchange/weather"</span><span class="p">);</span>
+ <span class="n">sender</span><span class="p">.</span><span class="n">send</span><span class="p">(</span><span class="n">message</span><span class="p">);</span>
+
+ <span class="n">Message</span> <span class="n">response</span> <span class="o">=</span> <span class="n">receiver</span><span class="p">.</span><span class="n">fetch</span><span class="p">();</span>
+
+ <span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o"><<</span> <span class="n">response</span><span class="p">.</span><span class="n">getContent</span><span class="p">()</span> <span class="o"><<</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
+
+ <span class="n">connection</span><span class="p">.</span><span class="n">close</span><span class="p">();</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+ <span class="p">}</span> <span class="k">catch</span><span class="p">(</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">exception</span><span class="o">&</span> <span class="n">error</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">std</span><span class="o">::</span><span class="n">cerr</span> <span class="o"><<</span> <span class="n">error</span><span class="p">.</span><span class="n">what</span><span class="p">()</span> <span class="o"><<</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
+ <span class="n">connection</span><span class="p">.</span><span class="n">close</span><span class="p">();</span>
+ <span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
+ <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+
+<p><a href="hello_xml.cpp">Download this file</a></p>
+
+
+ <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/eff0fe55/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/index.html
----------------------------------------------------------------------
diff --git a/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/index.html b/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/index.html
new file mode 100644
index 0000000..2d18982
--- /dev/null
+++ b/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/index.html
@@ -0,0 +1,168 @@
+<!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>C++ Messaging API Examples - 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/java-broker/index.html">Broker for Java</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.35.0/index.html">Qpid C++ 1.35.0</a></li><li>C++ Messaging API Examples</li></ul>
+
+ <div id="-middle-content">
+ <h1 id="c-messaging-api-examples">C++ Messaging API Examples</h1>
+
+<h2 id="example-files">Example files</h2>
+
+<ul>
+<li><a href="OptionParser.cpp.html">OptionParser.cpp</a></li>
+<li><a href="OptionParser.h.html">OptionParser.h</a></li>
+<li><a href="client.cpp.html">client.cpp</a></li>
+<li><a href="drain.cpp.html">drain.cpp</a></li>
+<li><a href="hello_world.cpp.html">hello_world.cpp</a></li>
+<li><a href="hello_xml.cpp.html">hello_xml.cpp</a></li>
+<li><a href="map_receiver.cpp.html">map_receiver.cpp</a></li>
+<li><a href="map_sender.cpp.html">map_sender.cpp</a></li>
+<li><a href="server.cpp.html">server.cpp</a></li>
+<li><a href="server_reconnect.cpp.html">server_reconnect.cpp</a></li>
+<li><a href="spout.cpp.html">spout.cpp</a></li>
+</ul>
+
+<h2 id="more-information">More information</h2>
+
+<ul>
+<li><a href="https://git-wip-us.apache.org/repos/asf?p=qpid-cpp.git;a=blob_plain;f=examples/README.txt;hb=refs/heads/master">README</a></li>
+<li><a href="https://git-wip-us.apache.org/repos/asf?p=qpid-cpp.git;a=tree;f=examples/messaging;hb=refs/heads/master">Source location</a></li>
+</ul>
+
+
+ <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/eff0fe55/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/map_receiver.cpp
----------------------------------------------------------------------
diff --git a/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/map_receiver.cpp b/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/map_receiver.cpp
new file mode 100755
index 0000000..96bc76b
--- /dev/null
+++ b/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/map_receiver.cpp
@@ -0,0 +1,58 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+#include <qpid/messaging/Connection.h>
+#include <qpid/messaging/Message.h>
+#include <qpid/messaging/Receiver.h>
+#include <qpid/messaging/Session.h>
+
+#include <cstdlib>
+#include <iostream>
+
+#include <sstream>
+
+using namespace qpid::messaging;
+using namespace qpid::types;
+
+using std::stringstream;
+using std::string;
+
+int main(int argc, char** argv) {
+ const char* url = argc>1 ? argv[1] : "amqp:tcp:127.0.0.1:5672";
+ const char* address = argc>2 ? argv[2] : "message_queue; {create: always}";
+ std::string connectionOptions = argc > 3 ? argv[3] : "";
+
+ Connection connection(url, connectionOptions);
+ try {
+ connection.open();
+ Session session = connection.createSession();
+ Receiver receiver = session.createReceiver(address);
+ std::cout << receiver.fetch().getContentObject() << std::endl;
+ session.acknowledge();
+ receiver.close();
+ connection.close();
+ return 0;
+ } catch(const std::exception& error) {
+ std::cout << error.what() << std::endl;
+ connection.close();
+ }
+ return 1;
+}
http://git-wip-us.apache.org/repos/asf/qpid-site/blob/eff0fe55/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/map_receiver.cpp.html
----------------------------------------------------------------------
diff --git a/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/map_receiver.cpp.html b/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/map_receiver.cpp.html
new file mode 100644
index 0000000..020b1f6
--- /dev/null
+++ b/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/map_receiver.cpp.html
@@ -0,0 +1,186 @@
+<!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>map_receiver.cpp - 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/java-broker/index.html">Broker for Java</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.35.0/index.html">Qpid C++ 1.35.0</a></li><li><a href="/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/index.html">C++ Messaging API Examples</a></li><li>map_receiver.cpp</li></ul>
+
+ <div id="-middle-content">
+
+<h1>map_receiver.cpp</h1>
+<div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><qpid/messaging/Connection.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><qpid/messaging/Message.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><qpid/messaging/Receiver.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><qpid/messaging/Session.h></span><span class="cp"></span>
+
+<span class="cp">#include</span> <span class="cpf"><cstdlib></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><iostream></span><span class="cp"></span>
+
+<span class="cp">#include</span> <span class="cpf"><sstream></span><span class="cp"></span>
+
+<span class="k">using</span> <span class="k">namespace</span> <span class="n">qpid</span><span class="o">::</span><span class="n">messaging</span><span class="p">;</span>
+<span class="k">using</span> <span class="k">namespace</span> <span class="n">qpid</span><span class="o">::</span><span class="n">types</span><span class="p">;</span>
+
+<span class="k">using</span> <span class="n">std</span><span class="o">::</span><span class="n">stringstream</span><span class="p">;</span>
+<span class="k">using</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="p">;</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span><span class="o">**</span> <span class="n">argv</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">const</span> <span class="kt">char</span><span class="o">*</span> <span class="n">url</span> <span class="o">=</span> <span class="n">argc</span><span class="o">></span><span class="mi">1</span> <span class="o">?</span> <span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">:</span> <span class="s">"amqp:tcp:127.0.0.1:5672"</span><span class="p">;</span>
+ <span class="k">const</span> <span class="kt">char</span><span class="o">*</span> <span class="n">address</span> <span class="o">=</span> <span class="n">argc</span><span class="o">></span><span class="mi">2</span> <span class="o">?</span> <span class="n">argv</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span> <span class="o">:</span> <span class="s">"message_queue; {create: always}"</span><span class="p">;</span>
+ <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">connectionOptions</span> <span class="o">=</span> <span class="n">argc</span> <span class="o">></span> <span class="mi">3</span> <span class="o">?</span> <span class="n">argv</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span> <span class="o">:</span> <span class="s">""</span><span class="p">;</span>
+
+ <span class="n">Connection</span> <span class="n">connection</span><span class="p">(</span><span class="n">url</span><span class="p">,</span> <span class="n">connectionOptions</span><span class="p">);</span>
+ <span class="k">try</span> <span class="p">{</span>
+ <span class="n">connection</span><span class="p">.</span><span class="n">open</span><span class="p">();</span>
+ <span class="n">Session</span> <span class="n">session</span> <span class="o">=</span> <span class="n">connection</span><span class="p">.</span><span class="n">createSession</span><span class="p">();</span>
+ <span class="n">Receiver</span> <span class="n">receiver</span> <span class="o">=</span> <span class="n">session</span><span class="p">.</span><span class="n">createReceiver</span><span class="p">(</span><span class="n">address</span><span class="p">);</span>
+ <span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o"><<</span> <span class="n">receiver</span><span class="p">.</span><span class="n">fetch</span><span class="p">().</span><span class="n">getContentObject</span><span class="p">()</span> <span class="o"><<</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
+ <span class="n">session</span><span class="p">.</span><span class="n">acknowledge</span><span class="p">();</span>
+ <span class="n">receiver</span><span class="p">.</span><span class="n">close</span><span class="p">();</span>
+ <span class="n">connection</span><span class="p">.</span><span class="n">close</span><span class="p">();</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+ <span class="p">}</span> <span class="k">catch</span><span class="p">(</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">exception</span><span class="o">&</span> <span class="n">error</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o"><<</span> <span class="n">error</span><span class="p">.</span><span class="n">what</span><span class="p">()</span> <span class="o"><<</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
+ <span class="n">connection</span><span class="p">.</span><span class="n">close</span><span class="p">();</span>
+ <span class="p">}</span>
+ <span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+
+<p><a href="map_receiver.cpp">Download this file</a></p>
+
+
+ <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/eff0fe55/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/map_sender.cpp
----------------------------------------------------------------------
diff --git a/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/map_sender.cpp b/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/map_sender.cpp
new file mode 100755
index 0000000..81ac732
--- /dev/null
+++ b/content/releases/qpid-cpp-1.35.0/messaging-api/cpp/examples/map_sender.cpp
@@ -0,0 +1,73 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+#include <qpid/messaging/Connection.h>
+#include <qpid/messaging/Message.h>
+#include <qpid/messaging/Sender.h>
+#include <qpid/messaging/Session.h>
+
+#include <cstdlib>
+#include <iostream>
+
+#include <sstream>
+
+using namespace qpid::messaging;
+using namespace qpid::types;
+
+using std::stringstream;
+using std::string;
+
+int main(int argc, char** argv) {
+ const char* url = argc>1 ? argv[1] : "amqp:tcp:127.0.0.1:5672";
+ const char* address = argc>2 ? argv[2] : "message_queue; {create: always}";
+ std::string connectionOptions = argc > 3 ? argv[3] : "";
+
+ Connection connection(url, connectionOptions);
+ try {
+ connection.open();
+ Session session = connection.createSession();
+ Sender sender = session.createSender(address);
+
+ Message message;
+ Variant::Map content;
+ content["id"] = 987654321;
+ content["name"] = "Widget";
+ content["percent"] = 0.99;
+ Variant::List colours;
+ colours.push_back(Variant("red"));
+ colours.push_back(Variant("green"));
+ colours.push_back(Variant("white"));
+ content["colours"] = colours;
+ content["uuid"] = Uuid(true);
+ message.setContentObject(content);
+
+ sender.send(message, true);
+
+ connection.close();
+ return 0;
+ } catch(const std::exception& error) {
+ std::cout << error.what() << std::endl;
+ connection.close();
+ }
+ return 1;
+}
+
+
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org