2d2820c9dc71cf17e1efd08177c1001b34b250cf,pubsub/cloud-client/publisher.py,,publish_messages_with_custom_attributes,#,105

Before Change


        // Data must be a bytestring
        data = data.encode("utf-8")
        // Add two attributes, origin and username, to the message
        publisher.publish(
            topic_path, data, origin="python-sample", username="gcp")

    print("Published messages with custom attributes.")
    // [END pubsub_publish_custom_attributes]

After Change


        // Data must be a bytestring
        data = data.encode("utf-8")
        // Add two attributes, origin and username, to the message
        future = publisher.publish(
            topic_path, data, origin="python-sample", username="gcp")
        print(future.result())

    print("Published messages with custom attributes.")
    // [END pubsub_publish_custom_attributes]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 2d2820c9dc71cf17e1efd08177c1001b34b250cf
Time: 2019-06-20
Author: anguillanneuf@gmail.com
File Name: pubsub/cloud-client/publisher.py
Class Name:
Method Name: publish_messages_with_custom_attributes


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 2d2820c9dc71cf17e1efd08177c1001b34b250cf
Time: 2019-06-20
Author: anguillanneuf@gmail.com
File Name: pubsub/cloud-client/subscriber_test.py
Class Name:
Method Name: _publish_messages


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 2d2820c9dc71cf17e1efd08177c1001b34b250cf
Time: 2019-06-20
Author: anguillanneuf@gmail.com
File Name: pubsub/cloud-client/publisher.py
Class Name:
Method Name: publish_messages_with_batch_settings


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 2d2820c9dc71cf17e1efd08177c1001b34b250cf
Time: 2019-06-20
Author: anguillanneuf@gmail.com
File Name: pubsub/cloud-client/subscriber_test.py
Class Name:
Method Name: _publish_messages_with_custom_attributes