def METHOD_NAME():
    """Test writing simple messages to a Pulsar topic with PulsarWriter"""
    topic = "test-write-simple-messages"
    writer = tfio.experimental.streaming.PulsarWriter(
        service_url="pulsar://localhost:6650", topic=topic
    )
    # 1. Write 10 messages
    for i in range(10):
        writer.write("msg-" + str(i))
    writer.flush()
    # 2. Consume messages and verify
    dataset = tfio.experimental.streaming.PulsarIODataset(
        service_url="pulsar://localhost:6650",
        topic=topic,
        subscription="subscription-0",
        timeout=default_pulsar_timeout,
    )
    assert np.all(
        [k.numpy() for (k, _) in dataset]
        == [("msg-" + str(i)).encode() for i in range(10)]
    )