async def METHOD_NAME(consumer):
    async with consumer:
        try:
            await consumer.receive(
                on_event=on_event,
                starting_position="-1",  # "-1" is from the beginning of the partition.
            )
        except KeyboardInterrupt:
            print('Stopped receiving.')