This is a small Jackson plugin to allow you to serialize QuickFixJ objects into JSON, as described by the FIX JSON encoding specification
This is a stand-alone jar, and doesn't require Symphony or any of the other components described in this project.
Maven coordinates are:
<groupId>com.github.deutschebank.symphonyp</groupId>
<artifactId>jackson-quickfix-module</artifactId>
<version>find latest in artifiactory</version>
Build an ObjectMapper
instance in Jackson like this:
ObjectMapper om = new ObjectMapper();
om.registerModule(new QuickfixjModule());
This example from the test:
Map<String, Object> in = new HashMap<>();
in.put("object001", createComplexFixMessage());
String out = om.writeValueAsString(in);
Creates the following FIX JSON output:
{
"object001": {
"Header": {
"BeginString": "FIX.5.0",
"MsgType": "6",
"SenderCompID": "Deutsche Bank",
"TargetCompID": "Credit Suisse"
},
"Body": {
"IOIID": "638d5f83-ab40-4c3e-aebe-15bc2620996f",
"IOIQty": "1000",
"IOITransType": "N",
"Side": "B",
"Symbol": "MSFT",
"Text": "Place My Order!"
},
"Trailer": {
}
}
}
works pretty much the same way:
MarketDataSnapshotFullRefresh o = om.readValue(in, MarketDataSnapshotFullRefresh.class);
This will deserialize a FIX JSON object into a MarketDataSnapshotFullRefresh
object.
FIX.5.0sp2 is included on the classpath by default. If you supply a different fix version to this, it will try to deserialize with the supplied version if the classes are on the classpath, otherwise it will attempt to use the latest, FIX.5.0sp2 version.