MsgPack debugging and validation tool also usable as Fiddler plugin
More info about this application (and screenshots) can be found at: http://www.infotopie.nl/open-source/msgpack-explorer
Although the original was optimised for debugging and analysing, a lightweight version of the lib is included which does not keep track of all offsets and other overhead needed for debugging. It can be used in your code.
Add LsMsgPackL.dll as a reference.
public class MyClass
{
public string Name { get; set; }
public int Quantity { get; set; }
public List<object> Anything { get; set; }
}
public void Test()
{
MyClass message = new MyClass()
{
Name = "Test message",
Quantity = 100,
Anything = new List<object>(new object[] { "first", 2, false, null, 4.2d, "last" })
};
// Serialize
byte[] buffer = MsgPackSerializer.Serialize(message);
// Deserialize
MyClass returnMsg = MsgPackSerializer.Deserialize<MyClass>(buffer);
}
I have never run any benchmarks so I have no idea how it will perform against other implementations.
In order to use this tool as a Fiddler plugin, copy the following files to the Fiddler Inspectors directory (usually C:\Program Files\Fiddler2\Inspectors):
- MsgPackExplorer.exe
- LsMsgPackFiddlerInspector.dll
- LsMsgPack.dll
Restart fiddler and you should see a MsgPack option in the Inspectors list.
This module contains the "parser" and generator of MsgPack Packages. It breaks down the binary file into a hirarchical structure, keeping track of offsets and errors. And it can also be used to generate MsgPack files.
The main winforms executable, containing a MsgPackExplorer UserControl (so it can easily be integrated into other tools such as Fiddler).
A tiny wrapper enabling the use of MsgPack Explorer as a Fiddler Inspector.
Some unit tests on the core LsMsgPack.dll. No full coverage yet, but at least it's a start.
A light version of the serializer. The parsing and generating methods are almost identical to the LsMsgPack lib, but with allot of overhead removed that comes with keeping track of offsets, original types and other debugging info. I'm planning to use this version in my projects that use the MsgPack format.
Each class can serialize/deserialize the associated MsgPack type. Types that have a variable length inherit from MsgPackVarLen.
The MsgPackSerializer and MsgPackSettings are the ones that end-users are supposed to use (entry points).