def METHOD_NAME(domain_id, sample_count, password):
    participant = dds.DomainParticipant(domain_id)
    # Participant properties give access to the builtin readers
    participant.participant_reader.set_listener(
        BuiltinParticipantListener(password), dds.StatusMask.DATA_AVAILABLE
    )
    participant.subscription_reader.set_listener(
        BuiltinSubscriptionListener(), dds.StatusMask.DATA_AVAILABLE
    )
    participant.enable()
    topic = dds.Topic(participant, "Example msg", String)
    writer = dds.DataWriter(dds.Publisher(participant), topic)
    # write String data samples in a loop
    count = 0
    while (sample_count == 0) or (count < sample_count):
        time.sleep(1)
        writer.write(String(f"Message #{count}"))
        count += 1