老的 msgpack-java(例如 0.6.7)並不支持 MessagePack str8 數據類型。java
當你的但願的你的應用程序須要支持老的版本的話,你須要禁用這個數據類型,例如使用下面的語句:app
MessagePack.PackerConfig config = new MessagePack.PackerConfig().withStr8FormatSupport(false); ObjectMapper mapperWithConfig = new ObjectMapper(new MessagePackFactory(config)); // This string is serialized as bin8 type byte[] resultWithoutStr8Format = mapperWithConfig.writeValueAsBytes(str8LengthString);
https://www.cwiki.us/display/Serialization/MessagePack+Jackson+Dataformatorm