Evolve your schema
You can update the schema to keep track of the type of operating system (OS) from the host(s) you are collecting data. After you update the schema, you need to reconfigure the consumer and producer to enable them to use the updated schema.
You have the application producing and consuming data and being monitored successfully, you identified a new requirement for your application and now you want to keep track of the type of OS from the host(s) you are collecting data.
{
"name": "os_type",
"doc": "OS type of the source machine",
"type": "string",
"default": "UNKNOWN"
}
Because this is a new field in the schema, you need to specify a default
value, as shown above, so that you can maintain backward compatibility, which is being
enforced by Schema Registry. If you do not do this, Schema Registry does not allow the
new schema to be used. You can check the complete modified schema in the
https://github.com/asdaraujo/cdp-examples/blob/master/src/main/avro/MachineData.v2.avsc
file.
This section covers the modification of the schema and verification of what changed in Schema Registry and Streams Messaging Manager (SMM).