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
        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"
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

Examples can be found in testsopen in new window.