From 145ca335a33fde045682409939acbaa2369cd52c Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Tue, 28 Jul 2015 18:42:39 +0000 Subject: NO-JIRA: update hello world example to use recommended api for content manipulation git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1693139 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/examples/messaging/hello_world.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'qpid/cpp/examples/messaging/hello_world.cpp') diff --git a/qpid/cpp/examples/messaging/hello_world.cpp b/qpid/cpp/examples/messaging/hello_world.cpp index a868a64b5e..61894f4667 100644 --- a/qpid/cpp/examples/messaging/hello_world.cpp +++ b/qpid/cpp/examples/messaging/hello_world.cpp @@ -42,9 +42,12 @@ int main(int argc, char** argv) { Receiver receiver = session.createReceiver(address); Sender sender = session.createSender(address); - sender.send(Message("Hello world!")); + Message message; + message.setContentObject("Hello world!"); + message.getContentObject().setEncoding("utf8"); + sender.send(message); - Message message = receiver.fetch(Duration::SECOND * 1); + message = receiver.fetch(Duration::SECOND * 1); std::cout << message.getContent() << std::endl; session.acknowledge(); -- cgit v1.2.1