On 01/08/2015 03:06 PM, Gordon Sim wrote:
On 01/08/2015 02:56 PM, Hamid.Shahid wrote:
Thanks Gordon,
But is it better to use /message.setContent(msgString)/ or to use
/message.setContentObject(msgString)/?
Use Message::setContentObject(). If you use setContent() the data will
be sent as a sequence of bytes rather than a utf8 string.
(In AMQP 0-10, content was always bytes, and you indicated the way those
bytes should be interpreted using a MIME type in setContentType(). In
AMQP 1.0, this approach is still possible, but the recommended approach
I believe is to use the AMQP typesystem to encode the content, which is
why the setContentObject() method was needed).
One clarification here: to send as utf8 you currently also need to set
the encoding of the content object. E.g.
Message m;
m.setContentObject("abc");
m.getContentObject().setEncoding("utf8");
I'd like to eliminate the need for that, but at present it is still
required.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]