diff --git a/esque/cli/commands.py b/esque/cli/commands.py index 286c4bb1..699e375a 100644 --- a/esque/cli/commands.py +++ b/esque/cli/commands.py @@ -1191,6 +1191,20 @@ def io(input_uri: str, output_uri: str): \b Available Serializers: + - raw + Doesn't deserialize the message payload and ignores the schema. Basically transfers messages 1:1. + Useful if you don't need to do any transformations and just want to get data from A to B without the overhead of + serialization, deserialization and schema handling. + WARNING: Be careful with data that has a schema which was or has to be registered by a schema registry! + This binary data is usually prefixed with a schema id that is valid only for one specific registry + instance. Transferring it to a different cluster 1:1 most likely makes it unable to be deserialized + because of two reasons: + 1. The schema id is from another schema registry instance and either doesn't exist on the target or + refers to the wrong schema. + 2. The schema was not registered for the target subject in the target schema registry. + Supported Parameters: + none + - json Supported Parameters: * indent diff --git a/esque/io/serializers/__init__.py b/esque/io/serializers/__init__.py index ad98ca6e..942de28b 100644 --- a/esque/io/serializers/__init__.py +++ b/esque/io/serializers/__init__.py @@ -3,6 +3,7 @@ from esque.io.exceptions import EsqueIOSerializerConfigException from esque.io.serializers.base import DataSerializer, SerializerConfig from esque.io.serializers.json import JsonSerializer +from esque.io.serializers.raw import RawSerializer from esque.io.serializers.registry_avro import RegistryAvroSerializer from esque.io.serializers.string import StringSerializer @@ -12,6 +13,7 @@ "str": StringSerializer, "reg-avro": RegistryAvroSerializer, "json": JsonSerializer, + "raw": RawSerializer, } diff --git a/esque/io/serializers/raw.py b/esque/io/serializers/raw.py index 6b053739..ece53d21 100644 --- a/esque/io/serializers/raw.py +++ b/esque/io/serializers/raw.py @@ -11,6 +11,7 @@ class RawSerializerConfig(SerializerConfig): class RawSerializer(DataSerializer): + config_cls = RawSerializerConfig unknown_data_type: UnknownDataType = UnknownDataType() def deserialize(self, raw_data: bytes) -> Data: