Every .NET example I have seen uses code similar to the following to retrieve
messages:
...IMessage m...
BinaryReader reader = new BinaryReader(m.Body, Encoding.UTF8);
byte[] body = new byte[m.Body.Length - m.Body.Position];
reader.Read(body, 0, body.Length);
ASCIIEncoding enc = new ASCIIEncoding();
string message = enc.GetString(body);
Isn't there a way for me to access fields of a message using a more type
safe way:
m.getFloat("nameoffloatfield");
m.getString("nameofstringfield");
Instead of pointing out flaws, I am actually trying to write a utility class
which will let users of .NET qpid access messages through a clean event
based interface...but in order to get there I need the lower layer to be a
bit saner :)
Any quick examples of how I retrieve a couple of attributes of different
types?
Thanks
--
View this message in context:
http://n2.nabble.com/c--message-retreival-without-resorting-to-encodings-and-bytes-readers--tp2222774p2222774.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:[email protected]