summaryrefslogtreecommitdiff
path: root/cpp/examples/messaging/drain.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2010-03-31 16:17:17 +0000
committerGordon Sim <gsim@apache.org>2010-03-31 16:17:17 +0000
commitf6f1900eb98cc1773a88a3ec309afa646438a384 (patch)
tree68e50e7aa1819afd283d73700965b539355a779d /cpp/examples/messaging/drain.cpp
parent887281838e4bf7825189ce3b0a8d7509789e6a08 (diff)
downloadqpid-python-f6f1900eb98cc1773a88a3ec309afa646438a384.tar.gz
QPID-664: made changes suggested by Alan Conway, also moved 0-10 map/list codecs to common lib
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@929606 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/examples/messaging/drain.cpp')
-rw-r--r--cpp/examples/messaging/drain.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/cpp/examples/messaging/drain.cpp b/cpp/examples/messaging/drain.cpp
index a2fa0f1138..1215ac75d2 100644
--- a/cpp/examples/messaging/drain.cpp
+++ b/cpp/examples/messaging/drain.cpp
@@ -20,7 +20,6 @@
*/
#include <qpid/messaging/Connection.h>
-#include <qpid/messaging/MapView.h>
#include <qpid/messaging/Message.h>
#include <qpid/messaging/Receiver.h>
#include <qpid/messaging/Session.h>
@@ -97,14 +96,16 @@ int main(int argc, char** argv)
Connection connection(options.connectionOptions);
try {
connection.open(options.url);
- Session session = connection.newSession();
+ Session session = connection.createSession();
Receiver receiver = session.createReceiver(options.address);
Duration timeout = options.getTimeout();
Message message;
while (receiver.fetch(message, timeout)) {
std::cout << "Message(properties=" << message.getProperties() << ", content='" ;
if (message.getContentType() == "amqp/map") {
- std::cout << MapView(message);
+ Variant::Map map;
+ decode(message, map);
+ std::cout << map;
} else {
std::cout << message.getContent();
}