From 9f634ba1b0f2ee6ea2f2e0c3a7a3d892d3eeda7c Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Wed, 17 Dec 2014 14:29:37 +0000 Subject: QPID-6273: ensure requests and responses are sent as textual strings rather than binary data git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1646259 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/examples/messaging/client.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'qpid/cpp/examples/messaging/client.cpp') diff --git a/qpid/cpp/examples/messaging/client.cpp b/qpid/cpp/examples/messaging/client.cpp index 983f0a8878..d695dd9ada 100644 --- a/qpid/cpp/examples/messaging/client.cpp +++ b/qpid/cpp/examples/messaging/client.cpp @@ -39,7 +39,7 @@ using std::string; int main(int argc, char** argv) { const char* url = argc>1 ? argv[1] : "amqp:tcp:127.0.0.1:5672"; std::string connectionOptions = argc > 2 ? argv[2] : ""; - + Connection connection(url, connectionOptions); try { connection.open(); @@ -62,10 +62,10 @@ int main(int argc, char** argv) { Message request; request.setReplyTo(responseQueue); for (int i=0; i<4; i++) { - request.setContent(s[i]); + request.setContentObject(s[i]); sender.send(request); Message response = receiver.fetch(); - std::cout << request.getContent() << " -> " << response.getContent() << std::endl; + std::cout << request.getContentObject() << " -> " << response.getContentObject() << std::endl; } connection.close(); return 0; -- cgit v1.2.1 From 55c2d83286aef546d0aaa3e3ecaf323a70abe0b7 Mon Sep 17 00:00:00 2001 From: "Charles E. Rolke" Date: Thu, 8 Jan 2015 19:28:51 +0000 Subject: QPID-6301: [C++ Messaging] Client example acks responses git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1650359 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/examples/messaging/client.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'qpid/cpp/examples/messaging/client.cpp') diff --git a/qpid/cpp/examples/messaging/client.cpp b/qpid/cpp/examples/messaging/client.cpp index d695dd9ada..44720ef3ce 100644 --- a/qpid/cpp/examples/messaging/client.cpp +++ b/qpid/cpp/examples/messaging/client.cpp @@ -7,9 +7,9 @@ * 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 @@ -66,6 +66,7 @@ int main(int argc, char** argv) { sender.send(request); Message response = receiver.fetch(); std::cout << request.getContentObject() << " -> " << response.getContentObject() << std::endl; + session.acknowledge(response); } connection.close(); return 0; -- cgit v1.2.1