Class MsgPackSerializer

All Implemented Interfaces:
MoleculerLifecycle

public class MsgPackSerializer extends Serializer
MessagePack serializer

MessagePack is an efficient binary serialization format. It lets you exchange data among multiple languages like JSON. But it's faster and smaller. Small integers are encoded into a single byte, and typical short strings require only one extra byte in addition to the strings themselves. This serializer is COMPATIBLE with the JavaScript/Node version of Moleculer. Sample of usage:
Transporter trans = new NatsTransporter("localhost");
trans.setSerializer(new MsgPackSerializer());
ServiceBroker broker = ServiceBroker.builder()
                                    .nodeID("node1")
                                    .transporter(trans)
                                    .build();
Required dependency:

https://mvnrepository.com/artifact/org.msgpack/msgpack
compile group: 'org.msgpack', name: 'msgpack', version: '0.6.12'
See Also:
  • Constructor Details

    • MsgPackSerializer

      public MsgPackSerializer()