qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alan Conway <acon...@redhat.com>
Subject Re: [Proton-c] [0.14.0] C++ sending/receiving bytes and map messages
Date Tue, 25 Oct 2016 18:30:10 GMT
On Thu, 2016-10-20 at 12:59 +0000, Adel Boutros wrote:
> Hello,
> 
> 
> It seems with 0.12.2, we were able to receive a bytes message by
> using (msg.body.get(std::string)). However it seems this is no longer
> the case on 0.14.0.
> 
> 
> I was wondering if there is there an example which explain how to
> send bytes and map messages?
> 
> 
> I found the below code for bytes in reactor_send.cpp :
> 
>         proton::binary content;
>         content.assign((size_t) size, 'X');
>         message_.body(content);
> 

examples/cpp/simple_send.cpp sends a map, the proton::binary type is
the right way to send bytes. examples/cpp/encode_decode.cpp shows how
to convert a variety of C++ types to/from a proton::value, which is the
type used to set/get the message body. There is also some discussion in
the docs https://qpid.apache.org/releases/qpid-proton-0.15.0/proton/cpp
/api/md_types.html

Please shout if you have more questions or suggestions to improve the
doc/examples.

Cheers,
Alan.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Mime
View raw message