Re: Using Qpid Proton 0.4 to iterate over arbitrary AMQP message

2013-07-25 Thread Rafael Schloming
On Wed, Jul 24, 2013 at 4:54 PM, amqp1 wrote: > Thanks, Rafael, I will check the Python doc. > > Thinking of the message structure as a tree makes it easier to grasp what > the function names mean. > > Does enter/exit make sense for arrays? Are composite types nestable? (Sorry > for the dumb ques

Re: Using Qpid Proton 0.4 to iterate over arbitrary AMQP message

2013-07-24 Thread amqp1
Thanks, Rafael, I will check the Python doc. Thinking of the message structure as a tree makes it easier to grasp what the function names mean. Does enter/exit make sense for arrays? Are composite types nestable? (Sorry for the dumb questions, I am getting up to speed with AMQP.) Hopefully, I'll

Re: Using Qpid Proton 0.4 to iterate over arbitrary AMQP message

2013-07-24 Thread Rafael Schloming
Have you found/read this documentation?: http://qpid.apache.org/releases/qpid-proton-0.4/protocol-engine/python/api/proton.Data-class.html It's for the python binding to the API, but the background it gives should be useful for understanding the model behind the C API as well. I believe all you w

Re: Using Qpid Proton 0.4 to iterate over arbitrary AMQP message

2013-07-24 Thread Darryl L. Pierce
On Tue, Jul 23, 2013 at 01:59:19PM -0700, amqp1 wrote: > Oh yes, I posted this via the Web interface...don't know why it didn't make > it into the list... > > pn_data_t *body = pn_message_body(amqpMessage); > > while (pn_data_next(body)) > { > pn_type_t type = pn_data_type(bod

Re: Using Qpid Proton 0.4 to iterate over arbitrary AMQP message

2013-07-23 Thread amqp1
I know how to fix that particular problem in my snippet of code, I just need to remove pn_data_enter(body); and pn_data_next(body); and pn_data_exit(body); since that "field" is at the top level of the message. My query is more about how to do it for all types, map, list, etc. in the general case

Re: Using Qpid Proton 0.4 to iterate over arbitrary AMQP message

2013-07-23 Thread amqp1
Oh yes, I posted this via the Web interface...don't know why it didn't make it into the list... pn_data_t *body = pn_message_body(amqpMessage); while (pn_data_next(body)) { pn_type_t type = pn_data_type(body); switch (type) { case PN_BINARY: {

Re: Using Qpid Proton 0.4 to iterate over arbitrary AMQP message

2013-07-23 Thread Robbie Gemmell
On 23 July 2013 20:04, Darryl L. Pierce wrote: > On Tue, Jul 23, 2013 at 11:42:42AM -0700, amqp1 wrote: > > I am trying to write C code to iterate over received arbitrary AMQP > messages. > > The API is essentially undocumented, so I tried my best with reading the > > source and guessing, but it

Re: Using Qpid Proton 0.4 to iterate over arbitrary AMQP message

2013-07-23 Thread Darryl L. Pierce
On Tue, Jul 23, 2013 at 11:42:42AM -0700, amqp1 wrote: > I am trying to write C code to iterate over received arbitrary AMQP messages. > The API is essentially undocumented, so I tried my best with reading the > source and guessing, but it doesn't work. > > Here is a snippet of what I have: > >

Using Qpid Proton 0.4 to iterate over arbitrary AMQP message

2013-07-23 Thread amqp1
I am trying to write C code to iterate over received arbitrary AMQP messages. The API is essentially undocumented, so I tried my best with reading the source and guessing, but it doesn't work. Here is a snippet of what I have: Is there a complete and accurate example showing how to iterate over