def METHOD_NAME(self) -> KafkaEventRecord:
    """
    Returns the next Kafka record using an iterator.
    Returns
    -------
    KafkaEventRecord
        The next Kafka record.
    Raises
    ------
    StopIteration
        If there are no more records available.
    """
    if self._records is None:
        self._records = self.records
    return next(self._records)