The default message storage period (offset) in kafka is one week, i.e.) 7 days.
After the expiration of the storage period, all existing offsets will be deleted from the intermediary in order to avoid space overflow.
therefore, the previous offset will be changed to the last offset, as kafka / zookeeper deleted the previous offset.
If you want your message to be long, specify the value - retention-period when creating a topic in kafka.
source share