// Module included in the following assemblies:
//
// assembly-upgrade.adoc

[id='ref-kafka-versions-{context}']

= Kafka versions

Kafka's log message format version and inter-broker protocol version specify, respectively, the log format version appended to messages and the version of the Kafka protocol used in a cluster. 
To ensure the correct versions are used, the upgrade process involves making configuration changes to existing Kafka brokers and code changes to client applications (consumers and producers).

The following table shows the differences between Kafka versions:

include::snip-kafka-versions.adoc[leveloffset=+1]

.Inter-broker protocol version

In Kafka, the network protocol used for inter-broker communication is called the _inter-broker protocol_. 
Each version of Kafka has a compatible version of the inter-broker protocol. 
The minor version of the protocol typically increases to match the minor version of Kafka, as shown in the preceding table.

The inter-broker protocol version is set cluster wide in the `Kafka` resource.  
To change it, you edit the `inter.broker.protocol.version` property in `Kafka.spec.kafka.config`.

.Log message format version

When a producer sends a message to a Kafka broker, the message is encoded using a specific format.
The format can change between Kafka releases, so messages specify which version of the format they were encoded with. You can configure a Kafka broker to convert messages from newer format versions to a given older format version before the broker appends the message to the log.

In Kafka, there are two different methods for setting the message format version:

* The `message.format.version` property is set on topics.
* The `log.message.format.version` property is set on Kafka brokers.

The default value of `message.format.version` for a topic is defined by the `log.message.format.version` that is set on the Kafka broker. You can manually set the `message.format.version` of a topic by modifying its topic configuration.

The upgrade tasks in this section assume that the message format version is defined by the `log.message.format.version`.
