.net - Is Binary Formatter good for MSMQ? -
i'm using msmq pass around xml. however, i'd make queue more generic, letting accept class instances messages. brings mind need binary formatter.
i've been reading binary formatter , msmq. seems using binary formatter, i'm making msmq isn't meant do. in other words, i'm passing binary based data on msmq when wants instead light , string based. or have wrong?
what i've read more complex types of data (i.e., binary), should stored in database. however, presents own issues since data serializable.
the data i'm passing isn't stream based.
if i'm going leverage msmq, should used strictly string based messages , not binary?
it seems using binary formatter, i'm making msmq isn't meant do.
you misinformed. in fact, msmq ships own binarymessageformatter class, intended used when want increase speed @ cost of flexibility.
the documentation has say:
the binarymessageformatter efficient , can used serialize objects. result compact , fast parse, not allow loosely coupled messaging xmlmessageformatter does. loosely coupled means client , server can independently version type sent , received.
when application sends message queue using instance of messagequeue class, formatter serializes object stream , inserts message body. when reading queue using messagequeue, formatter deserializes message data body property of message.
binarymessageformatter provides faster throughput xmlmessageformatter. use binarymessageformatter when pure speed rather loosely coupled messaging desired.
Comments
Post a Comment