Class SmileSerializer
java.lang.Object
services.moleculer.service.MoleculerComponent
services.moleculer.serializer.Serializer
services.moleculer.serializer.SmileSerializer
- All Implemented Interfaces:
MoleculerLifecycle
Smile Serializer
Smile is a computer data interchange format based on JSON. It can also be considered as a binary serialization of generic JSON data model, which means that tools that operate on JSON may be used with Smile as well, as long as proper encoder/decoder exists for tool to use. Compared to JSON, Smile is both more compact and more efficient to process (both to read and write).
It is the FASTEST serializer, but it is NOT compatible with the JavaScript/Node version of Moleculer. Sample of usage:
https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/ jackson-dataformat-smile
compile group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-smile', version: '2.10.1'
Smile is a computer data interchange format based on JSON. It can also be considered as a binary serialization of generic JSON data model, which means that tools that operate on JSON may be used with Smile as well, as long as proper encoder/decoder exists for tool to use. Compared to JSON, Smile is both more compact and more efficient to process (both to read and write).
It is the FASTEST serializer, but it is NOT compatible with the JavaScript/Node version of Moleculer. Sample of usage:
Transporter trans = new NatsTransporter("localhost");
trans.setSerializer(new SmileSerializer());
ServiceBroker broker = ServiceBroker.builder()
.nodeID("node1")
.transporter(trans)
.build();
Required dependency:https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/ jackson-dataformat-smile
compile group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-smile', version: '2.10.1'
- 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
-
SmileSerializer
public SmileSerializer()
-