def get_pulsar_producer_stage(pipeline_builder, topic):
    """Create and return a Pulsar Producer origin stage depending on execution mode for the pipeline."""

    pulsar_producer = pipeline_builder.add_stage('Pulsar Producer',
                                                 type='destination')
    pulsar_producer.set_attributes(data_format='TEXT',
                                   text_field_path='/text',
                                   topic=topic)
    return pulsar_producer