Class MsgPackSerializer
java.lang.Object
services.moleculer.service.MoleculerComponent
services.moleculer.serializer.Serializer
services.moleculer.serializer.MsgPackSerializer
- All Implemented Interfaces:
MoleculerLifecycle
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:
https://mvnrepository.com/artifact/org.msgpack/msgpack
compile group: 'org.msgpack', name: 'msgpack', version: '0.6.12'
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:
-
Field Summary
Fields inherited from class Serializer
debug, format, reader, writerFields inherited from class MoleculerComponent
broker, logger, name -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class MoleculerComponent
getBroker, getLogger, getName, stopped
-
Constructor Details
-
MsgPackSerializer
public MsgPackSerializer()
-