How do you consume a single message from a topic?
Implement consume_single_message(topic, offset). topic is a list of messages, and offset is the index of the next message to consume. Return a dictionary containing the consumed message and the next offset. If the offset is at the end of the topic, return {"message": None, "next_offset": offset} without changing the offset.
Function signature: consume_single_message(topic, offset)
def consume_single_message(topic, offset):