Class JsonSerializer

All Implemented Interfaces:
MoleculerLifecycle

public class JsonSerializer extends Serializer
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:
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:
  • Constructor Details

    • JsonSerializer

      public JsonSerializer()