Class CborSerializer
java.lang.Object
services.moleculer.service.MoleculerComponent
services.moleculer.serializer.Serializer
services.moleculer.serializer.CborSerializer
- All Implemented Interfaces:
MoleculerLifecycle
CBOR Serializer
CBOR is based on the wildly successful JSON data model: numbers, strings, arrays, maps (called objects in JSON), and a few values such as false, true, and null. One of the major practical wins of JSON is that successful data interchange is possible without casting a schema in concrete. This works much better in a world where both ends of a communication relationship may be evolving at high speed.
This serializer is NOT compatible with the JavaScript/Node version of Moleculer. Sample of usage:
https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/ jackson-dataformat-cbor
compile group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-cbor', version: '2.10.1'
CBOR is based on the wildly successful JSON data model: numbers, strings, arrays, maps (called objects in JSON), and a few values such as false, true, and null. One of the major practical wins of JSON is that successful data interchange is possible without casting a schema in concrete. This works much better in a world where both ends of a communication relationship may be evolving at high speed.
This serializer is NOT compatible with the JavaScript/Node version of Moleculer. Sample of usage:
Transporter trans = new NatsTransporter("localhost");
trans.setSerializer(new CborSerializer());
ServiceBroker broker = ServiceBroker.builder()
.nodeID("node1")
.transporter(trans)
.build();
Required dependency:https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/ jackson-dataformat-cbor
compile group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-cbor', 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
-
CborSerializer
public CborSerializer()
-