Class JsonSerializer
java.lang.Object
services.moleculer.service.MoleculerComponent
services.moleculer.serializer.Serializer
services.moleculer.serializer.JsonSerializer
- All Implemented Interfaces:
MoleculerLifecycle
Generic JSON serializer
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. This serializer is fully COMPATIBLE with the JavaScript/Node version of Moleculer, use this if possible. Sample of usage:
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. This serializer is fully COMPATIBLE with the JavaScript/Node version of Moleculer, use this if possible. Sample of usage:
Transporter trans = new NatsTransporter("localhost");
trans.setSerializer(new JsonSerializer());
ServiceBroker broker = ServiceBroker.builder()
.nodeID("node1")
.transporter(trans)
.build();
Required dependency: none / optional (eg. if you add Jackson API to
the classpath, JsonSerializer will user Jackson parser).- 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
-
JsonSerializer
public JsonSerializer()
-