@Override
    public void transform(Message message, DataType fromType, DataType toType) {
        ProtobufSchema schema = message.getExchange().getProperty(SchemaHelper.CONTENT_SCHEMA, ProtobufSchema.class);

        if (schema == null) {
            throw new CamelExecutionException("Missing proper Protobuf schema for data type processing", message.getExchange());
        }

        try {
            byte[] marshalled;

            String contentClass = SchemaHelper.resolveContentClass(message.getExchange(), null);
            if (contentClass != null) {
                Class<?> contentType
                        = message.getExchange().getContext().getClassResolver().resolveMandatoryClass(contentClass);
                marshalled = Protobuf.mapper().writer().forType(contentType).with(schema)
                        .writeValueAsBytes(message.getBody());
            } else {
                marshalled = Protobuf.mapper().writer().forType(JsonNode.class).with(schema)
                        .writeValueAsBytes(getBodyAsJsonNode(message, schema));
            }

            message.setBody(marshalled);

            message.setHeader(Exchange.CONTENT_TYPE, MimeType.PROTOBUF_BINARY.type());
            message.setHeader(SchemaHelper.CONTENT_SCHEMA, schema.getSource().toString());
        } catch (InvalidPayloadException | IOException | ClassNotFoundException e) {
            throw new CamelExecutionException(
                    "Failed to apply Protobuf binary data type on exchange", message.getExchange(), e);
        }
    }
@Test
    void shouldHandleJsonString() throws Exception {
        Exchange exchange = new DefaultExchange(camelContext);

        ProtobufSchema protobufSchema = getSchema();
        exchange.setProperty(SchemaHelper.CONTENT_SCHEMA, protobufSchema);
        exchange.getMessage().setBody("""
                    { "name": "Christoph", "age": 32 }
                """);
        transformer.transform(exchange.getMessage(), DataType.ANY, DataType.ANY);

        JSONAssert.assertEquals("""
                    { "name": "Christoph", "age": 32 }
                """, Json.mapper().writeValueAsString(
                Protobuf.mapper().reader().with(protobufSchema).readTree(exchange.getMessage().getBody(byte[].class))), true);
    }