Avro deserialization

Avro messages using Schema registry are automatically decoded if the registry is configured (see Kafka cluster).

You can also decode raw binary Avro messages, that is messages encoded directly with DatumWriteropen in new window without any header. You must provide a schemas-folder and mappings which associate a topic-regex and a schema file name. The schema can be specified either for message keys with key-schema-file and/or for values with value-schema-file.

Here is an example of configuration:

akhq:
  connections:
    kafka:
      properties:
        # standard kafka properties
      deserialization:
        avro-raw:
          schemas-folder: "/app/avro_schemas"
          topics-mapping:
            - topic-regex: "album.*"
              value-schema-file: "Album.avsc"
            - topic-regex: "film.*"
              value-schema-file: "Film.avsc"
            - topic-regex: "test.*"
              key-schema-file: "Key.avsc"
              value-schema-file: "Value.avsc"

Examples can be found in testsopen in new window.