Robbie Gemmell created QPID-6665:
------------------------------------
Summary: update hello_world.cpp example to use setContentObject
Key: QPID-6665
URL: https://issues.apache.org/jira/browse/QPID-6665
Project: Qpid
Issue Type: Improvement
Components: C++ Client
Affects Versions: qpid-cpp-0.34
Reporter: Robbie Gemmell
Assignee: Robbie Gemmell
Priority: Trivial
Fix For: qpid-cpp-next
The hello_world.cpp example for Qpid Messaging C++ currently sends its
message by doing "sender.send(Message("Hello world!"));" which causes
it to send a 'data' body section containing the bytes when using AMQP
1.0.
Aleternatively, doing the following results in the payload sent by the client
changing to an 'amqp-value' body section containing a utf8 string:
{noformat}
Message msg;
msg.setContentObject("Hello World!");
msg.getContentObject().setEncoding("utf8");
sender.send(msg);
{noformat}
The latter is probably more in line with expectation of sending a string, and
less likely to confuse when interoperating with other clients, and the other
examples already do this for string content so the hellow world example should
be updated to match.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]