public boolean hasOffset() {
        return this.offset != ProduceResponse.INVALID_OFFSET;
    }
Indicates whether the record metadata includes the offset.
@return true if the offset is included in the metadata, false otherwise.
clients/src/main/java/org/apache/kafka/clients/producer/RecordMetadata.java