I have a pipeline that has two kind of thrift message coming in
I can try deserializing each individually and see if it runs into error
TDeserializer deserializer = new TDeserializer(new TSimpleJSONProtocol.Factory());
try {
Type1Msg t1 = new Type1Msg();
deserializer.deserialize(t1, json, "UTF-8");
return t1
} catch() {
}
try {
Type2Msg t2 = new Type2Msg();
deserializer.deserialize(t1, json, "UTF-8");
return t2
} catch() {
}
Is there a idiomatic way of achieving deserializing multiple message type in thrift?