To use a custom schema, all you need to do is implement one of the SerializationSchema or DeserializationSchema interface.
public class MyMessageSchema implements DeserializationSchema<MyMessage>, SerializationSchema<MyMessage> {
@Override
public MyMessage deserialize(byte[]...