qpid-proton mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fraser Adams <fraser.ad...@blueyonder.co.uk>
Subject Re: Quotes in the message body
Date Thu, 27 Mar 2014 18:01:47 GMT
If you are using the recv client (which you look like you are using) 
then I *think* that what you are seeing is an artefact of that using 
pn_data_format, which generates a *formatted* response. I think that's 
because recv is intended to be a fairly general test client - when I 
sent a UUID to it the other day it displayed something like 
UUID(<my-uuid>), so the quotes are an artefact of the rendering rather 
than anything transmitted over the wire.

What you'd need to do is to have a client that did pn_data_get_string 
rather than pn_data_format. One thing to bear in mind is that 
pn_data_get_string returns a pn_bytes_t structure and not a char* string 
it looks something like:

typedef struct {
   size_t size;
   char *start;
} pn_bytes_t;

The call you'd need to make would I think look like:

pn_bytes_t bytes = pn_data_get_string(body);

But you'd need to make sure that you then created your own char* style 
null terminated string using the start and size stuff from bytes (likely 
via malloc and memcpy).

So in short I think that it relates to the recv client and if you want 
the unformatted string then you'd need to modify that to retrieve the 
string directly.

I'm still finding my own feet with the messenger API if there's a better 
approach then hopefully someone more authoritative will chip in.


On 26/03/14 20:56, serega wrote:
> I am using Qpid Proton Messenger with SwiftMQ JMS/AMQP broker.  On the
> receiving side the messenger surrounds message body with quotes.
> smeldris@labitpf2:~/qpid-proton-0.6/build/proton-c/examples/messenger/c>./send
> -a  amqp://
> Message_without_quotessmeldris@labitpf2:~/qpid-proton-0.6/build/proton-c/examples/messenger/c>smeldris@labitpf2:~/qpid-proton-0.6/build/proton-c/examples/messenger/c>./recv
> amqp://
> amqp:// (no subject)Content:
> "Message_without_quotes"
> Notice the '"' character on both sides of the body. The SwiftMQ is JMS
> broker which gives me more options to test. Receiving this message using JMS
> API yields a message body without quotes, so it clearly happens on the
> quid-proton receiving side.   I am stripping out the quotes, but I prefer to
> receive the original message without quotes.   - Sergey
> --
> View this message in context: http://qpid.2158936.n2.nabble.com/Quotes-in-the-message-body-tp7606053.html
> Sent from the Apache Qpid Proton mailing list archive at Nabble.com.

View raw message