Class CborSerializer

All Implemented Interfaces:
MoleculerLifecycle

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

    • CborSerializer

      public CborSerializer()