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 find most of my answers in the doc you referenced. Rafael Schloming-3 wrote > 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 would need to do to generalize your code to handle > arbitrary AMQP data is to extend the switch statement to cover the full > range of AMQP types present in the pn_type_t. (You should be able to find > the full list in the documentation link above.) > > Note that enter/exit are only used for entering and exiting composite data > types, i.e. map, list, and described types. The code you have for the > string case of your switch statement doesn't make sense as you are trying > to "enter" a string, however a string is a leaf node value. The call to > enter won't make a difference there, it will simply fail and return false, > however the call to next and exit will mess up the position of the cursor > within the data tree, pushing you ahead by one and then popping you up a > level. > > Hope this helps, if it's still not clear, please follow up and I'll put > together a proper example for you. > > --Rafael -- View this message in context: http://qpid.2158936.n2.nabble.com/Using-Qpid-Proton-0-4-to-iterate-over-arbitrary-AMQP-message-tp7595828p7595877.html Sent from the Apache Qpid users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
