From 71b4ebe2c3aa5fdd4579f5f13f688644b6a988dc Mon Sep 17 00:00:00 2001 From: Tianzi Cai Date: Wed, 17 Jul 2019 16:14:21 -0700 Subject: [PATCH 1/4] Publish retry sample --- pubsub/cloud-client/publisher.py | 174 ++++++++++++++++++-------- pubsub/cloud-client/publisher_test.py | 7 ++ 2 files changed, 130 insertions(+), 51 deletions(-) diff --git a/pubsub/cloud-client/publisher.py b/pubsub/cloud-client/publisher.py index 51edd7bd864..8bd9d8580ae 100644 --- a/pubsub/cloud-client/publisher.py +++ b/pubsub/cloud-client/publisher.py @@ -53,7 +53,7 @@ def create_topic(project_id, topic_name): topic = publisher.create_topic(topic_path) - print('Topic created: {}'.format(topic)) + print("Topic created: {}".format(topic)) # [END pubsub_quickstart_create_topic] # [END pubsub_create_topic] @@ -71,7 +71,7 @@ def delete_topic(project_id, topic_name): publisher.delete_topic(topic_path) - print('Topic deleted: {}'.format(topic_path)) + print("Topic deleted: {}".format(topic_path)) # [END pubsub_delete_topic] @@ -90,14 +90,14 @@ def publish_messages(project_id, topic_name): topic_path = publisher.topic_path(project_id, topic_name) for n in range(1, 10): - data = u'Message number {}'.format(n) + data = u"Message number {}".format(n) # Data must be a bytestring - data = data.encode('utf-8') + data = data.encode("utf-8") # When you publish a message, the client returns a future. future = publisher.publish(topic_path, data=data) print(future.result()) - print('Published messages.') + print("Published messages.") # [END pubsub_quickstart_publisher] # [END pubsub_publish] @@ -115,15 +115,16 @@ def publish_messages_with_custom_attributes(project_id, topic_name): topic_path = publisher.topic_path(project_id, topic_name) for n in range(1, 10): - data = u'Message number {}'.format(n) + data = u"Message number {}".format(n) # Data must be a bytestring - data = data.encode('utf-8') + 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') + topic_path, data, origin="python-sample", username="gcp" + ) print(future.result()) - print('Published messages with custom attributes.') + print("Published messages with custom attributes.") # [END pubsub_publish_custom_attributes] @@ -140,9 +141,9 @@ def publish_messages_with_futures(project_id, topic_name): topic_path = publisher.topic_path(project_id, topic_name) for n in range(1, 10): - data = u'Message number {}'.format(n) + data = u"Message number {}".format(n) # Data must be a bytestring - data = data.encode('utf-8') + data = data.encode("utf-8") # When you publish a message, the client returns a future. future = publisher.publish(topic_path, data=data) print(future.result()) @@ -171,8 +172,9 @@ def callback(f): try: print(f.result()) futures.pop(data) - except: # noqa + except: # noqa print("Please handle {} for {}.".format(f.exception(), data)) + return callback for i in range(10): @@ -180,8 +182,7 @@ def callback(f): futures.update({data: None}) # When you publish a message, the client returns a future. future = publisher.publish( - topic_path, - data=data.encode("utf-8"), # data must be a bytestring. + topic_path, data=data.encode("utf-8") # data must be a bytestring. ) futures[data] = future # Publish failures shall be handled in the callback function. @@ -207,78 +208,149 @@ def publish_messages_with_batch_settings(project_id, topic_name): # of data or one second has passed. batch_settings = pubsub_v1.types.BatchSettings( max_bytes=1024, # One kilobyte - max_latency=1, # One second + max_latency=1, # One second ) publisher = pubsub_v1.PublisherClient(batch_settings) topic_path = publisher.topic_path(project_id, topic_name) for n in range(1, 10): - data = u'Message number {}'.format(n) + data = u"Message number {}".format(n) # Data must be a bytestring - data = data.encode('utf-8') + data = data.encode("utf-8") future = publisher.publish(topic_path, data=data) print(future.result()) - print('Published messages with batch settings.') + print("Published messages with batch settings.") # [END pubsub_publisher_batch_settings] -if __name__ == '__main__': +def publish_messages_with_retry_settings(project_id, topic_name): + """Publishes messages with custom retry settings.""" + # [START pubsub_publisher_retry_settings] + from google.cloud import pubsub_v1 + + # TODO project_id = "Your Google Cloud Project ID" + # TODO topic_name = "Your Pub/Sub topic name" + + # Configure the retry settings. Defaults will be overwritten. + retry_settings = { + "interfaces": { + "google.pubsub.v1.Publisher": { + "retry_codes": { + "publish": [ + "ABORTED", + "CANCELLED", + "DEADLINE_EXCEEDED", + "INTERNAL", + "RESOURCE_EXHAUSTED", + "UNAVAILABLE", + "UNKNOWN", + ] + }, + "retry_params": { + "messaging": { + "initial_retry_delay_millis": 150, # default: 100 + "retry_delay_multiplier": 1.5, # default: 1.3 + "max_retry_delay_millis": 65000, # default: 60000 + "initial_rpc_timeout_millis": 25000, # default: 25000 + "rpc_timeout_multiplier": 1.0, # default: 1.0 + "max_rpc_timeout_millis": 35000, # default: 30000 + "total_timeout_millis": 650000, # default: 600000 + } + }, + "methods": { + "Publish": { + "retry_codes_name": "publish", + "retry_params_name": "messaging", + } + }, + } + } + } + + publisher = pubsub_v1.PublisherClient(client_config=retry_settings) + topic_path = publisher.topic_path(project_id, topic_name) + + for n in range(1, 10): + data = u"Message number {}".format(n) + # Data must be a bytestring + data = data.encode("utf-8") + future = publisher.publish(topic_path, data=data) + print(future.result()) + + print("Published messages with retry settings.") + # [END pubsub_publisher_retry_settings] + + +if __name__ == "__main__": parser = argparse.ArgumentParser( description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter ) - parser.add_argument('project_id', help='Your Google Cloud project ID') + parser.add_argument("project_id", help="Your Google Cloud project ID") - subparsers = parser.add_subparsers(dest='command') - subparsers.add_parser('list', help=list_topics.__doc__) + subparsers = parser.add_subparsers(dest="command") + subparsers.add_parser("list", help=list_topics.__doc__) - create_parser = subparsers.add_parser('create', help=create_topic.__doc__) - create_parser.add_argument('topic_name') + create_parser = subparsers.add_parser("create", + help=create_topic.__doc__) + create_parser.add_argument("topic_name") - delete_parser = subparsers.add_parser('delete', help=delete_topic.__doc__) - delete_parser.add_argument('topic_name') + delete_parser = subparsers.add_parser("delete", + help=delete_topic.__doc__) + delete_parser.add_argument("topic_name") - publish_parser = subparsers.add_parser( - 'publish', help=publish_messages.__doc__) - publish_parser.add_argument('topic_name') + publish_parser = subparsers.add_parser("publish", + help=publish_messages.__doc__) + publish_parser.add_argument("topic_name") publish_with_custom_attributes_parser = subparsers.add_parser( - 'publish-with-custom-attributes', - help=publish_messages_with_custom_attributes.__doc__) - publish_with_custom_attributes_parser.add_argument('topic_name') + "publish-with-custom-attributes", + help=publish_messages_with_custom_attributes.__doc__, + ) + publish_with_custom_attributes_parser.add_argument("topic_name") publish_with_futures_parser = subparsers.add_parser( - 'publish-with-futures', - help=publish_messages_with_futures.__doc__) - publish_with_futures_parser.add_argument('topic_name') + "publish-with-futures", help=publish_messages_with_futures.__doc__ + ) + publish_with_futures_parser.add_argument("topic_name") publish_with_error_handler_parser = subparsers.add_parser( - 'publish-with-error-handler', - help=publish_messages_with_error_handler.__doc__) - publish_with_error_handler_parser.add_argument('topic_name') + "publish-with-error-handler", + help=publish_messages_with_error_handler.__doc__ + ) + publish_with_error_handler_parser.add_argument("topic_name") publish_with_batch_settings_parser = subparsers.add_parser( - 'publish-with-batch-settings', - help=publish_messages_with_batch_settings.__doc__) - publish_with_batch_settings_parser.add_argument('topic_name') + "publish-with-batch-settings", + help=publish_messages_with_batch_settings.__doc__ + ) + publish_with_batch_settings_parser.add_argument("topic_name") + + publish_with_retry_settings_parser = subparsers.add_parser( + "publish-with-retry-settings", + help=publish_messages_with_retry_settings.__doc__ + ) + publish_with_retry_settings_parser.add_argument("topic_name") args = parser.parse_args() - if args.command == 'list': + if args.command == "list": list_topics(args.project_id) - elif args.command == 'create': + elif args.command == "create": create_topic(args.project_id, args.topic_name) - elif args.command == 'delete': + elif args.command == "delete": delete_topic(args.project_id, args.topic_name) - elif args.command == 'publish': + elif args.command == "publish": publish_messages(args.project_id, args.topic_name) - elif args.command == 'publish-with-custom-attributes': - publish_messages_with_custom_attributes( - args.project_id, args.topic_name) - elif args.command == 'publish-with-futures': + elif args.command == "publish-with-custom-attributes": + publish_messages_with_custom_attributes(args.project_id, + args.topic_name) + elif args.command == "publish-with-futures": publish_messages_with_futures(args.project_id, args.topic_name) - elif args.command == 'publish-with-error-handler': + elif args.command == "publish-with-error-handler": publish_messages_with_error_handler(args.project_id, args.topic_name) - elif args.command == 'publish-with-batch-settings': + elif args.command == "publish-with-batch-settings": publish_messages_with_batch_settings(args.project_id, args.topic_name) + elif args.command == "publish-with-retry-settings": + publish_messages_with_retry_settings(args.project_id, args.topic_name) diff --git a/pubsub/cloud-client/publisher_test.py b/pubsub/cloud-client/publisher_test.py index c2908d746a2..07a1032a5d0 100644 --- a/pubsub/cloud-client/publisher_test.py +++ b/pubsub/cloud-client/publisher_test.py @@ -110,6 +110,13 @@ def test_publish_with_batch_settings(topic, capsys): assert 'Published' in out +def test_publish_with_retry_settings(topic, capsys): + publisher.publish_messages_with_retry_settings(PROJECT, TOPIC) + + out, _ = capsys.readouterr() + assert 'Published' in out + + def test_publish_with_error_handler(topic, capsys): publisher.publish_messages_with_error_handler(PROJECT, TOPIC) From 39334384f5a5e0b6ebc29fcea8a6f022de1220e7 Mon Sep 17 00:00:00 2001 From: Tianzi Cai Date: Fri, 19 Jul 2019 15:24:33 -0700 Subject: [PATCH 2/4] double to single quotes --- pubsub/cloud-client/publisher.py | 90 ++++++++++++++++---------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/pubsub/cloud-client/publisher.py b/pubsub/cloud-client/publisher.py index 8bd9d8580ae..bce5c75f9a3 100644 --- a/pubsub/cloud-client/publisher.py +++ b/pubsub/cloud-client/publisher.py @@ -53,7 +53,7 @@ def create_topic(project_id, topic_name): topic = publisher.create_topic(topic_path) - print("Topic created: {}".format(topic)) + print('Topic created: {}'.format(topic)) # [END pubsub_quickstart_create_topic] # [END pubsub_create_topic] @@ -71,7 +71,7 @@ def delete_topic(project_id, topic_name): publisher.delete_topic(topic_path) - print("Topic deleted: {}".format(topic_path)) + print('Topic deleted: {}'.format(topic_path)) # [END pubsub_delete_topic] @@ -90,14 +90,14 @@ def publish_messages(project_id, topic_name): topic_path = publisher.topic_path(project_id, topic_name) for n in range(1, 10): - data = u"Message number {}".format(n) + data = u'Message number {}'.format(n) # Data must be a bytestring - data = data.encode("utf-8") + data = data.encode('utf-8') # When you publish a message, the client returns a future. future = publisher.publish(topic_path, data=data) print(future.result()) - print("Published messages.") + print('Published messages.') # [END pubsub_quickstart_publisher] # [END pubsub_publish] @@ -124,7 +124,7 @@ def publish_messages_with_custom_attributes(project_id, topic_name): ) print(future.result()) - print("Published messages with custom attributes.") + print('Published messages with custom attributes.') # [END pubsub_publish_custom_attributes] @@ -141,14 +141,14 @@ def publish_messages_with_futures(project_id, topic_name): topic_path = publisher.topic_path(project_id, topic_name) for n in range(1, 10): - data = u"Message number {}".format(n) + data = u'Message number {}'.format(n) # Data must be a bytestring - data = data.encode("utf-8") + data = data.encode('utf-8') # When you publish a message, the client returns a future. future = publisher.publish(topic_path, data=data) print(future.result()) - print("Published messages with futures.") + print('Published messages with futures.') # [END pubsub_publisher_concurrency_control] @@ -173,7 +173,7 @@ def callback(f): print(f.result()) futures.pop(data) except: # noqa - print("Please handle {} for {}.".format(f.exception(), data)) + print('Please handle {} for {}.'.format(f.exception(), data)) return callback @@ -182,7 +182,7 @@ def callback(f): futures.update({data: None}) # When you publish a message, the client returns a future. future = publisher.publish( - topic_path, data=data.encode("utf-8") # data must be a bytestring. + topic_path, data=data.encode('utf-8') # data must be a bytestring. ) futures[data] = future # Publish failures shall be handled in the callback function. @@ -192,7 +192,7 @@ def callback(f): while futures: time.sleep(5) - print("Published message with error handler.") + print('Published message with error handler.') # [END pubsub_publish_messages_error_handler] @@ -214,13 +214,13 @@ def publish_messages_with_batch_settings(project_id, topic_name): topic_path = publisher.topic_path(project_id, topic_name) for n in range(1, 10): - data = u"Message number {}".format(n) + data = u'Message number {}'.format(n) # Data must be a bytestring - data = data.encode("utf-8") + data = data.encode('utf-8') future = publisher.publish(topic_path, data=data) print(future.result()) - print("Published messages with batch settings.") + print('Published messages with batch settings.') # [END pubsub_publisher_batch_settings] @@ -272,13 +272,13 @@ def publish_messages_with_retry_settings(project_id, topic_name): topic_path = publisher.topic_path(project_id, topic_name) for n in range(1, 10): - data = u"Message number {}".format(n) + data = u'Message number {}'.format(n) # Data must be a bytestring - data = data.encode("utf-8") + data = data.encode('utf-8') future = publisher.publish(topic_path, data=data) print(future.result()) - print("Published messages with retry settings.") + print('Published messages with retry settings.') # [END pubsub_publisher_retry_settings] @@ -287,70 +287,70 @@ def publish_messages_with_retry_settings(project_id, topic_name): description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter ) - parser.add_argument("project_id", help="Your Google Cloud project ID") + parser.add_argument('project_id', help='Your Google Cloud project ID') - subparsers = parser.add_subparsers(dest="command") - subparsers.add_parser("list", help=list_topics.__doc__) + subparsers = parser.add_subparsers(dest='command') + subparsers.add_parser('list', help=list_topics.__doc__) - create_parser = subparsers.add_parser("create", + create_parser = subparsers.add_parser('create', help=create_topic.__doc__) - create_parser.add_argument("topic_name") + create_parser.add_argument('topic_name') - delete_parser = subparsers.add_parser("delete", + delete_parser = subparsers.add_parser('delete', help=delete_topic.__doc__) - delete_parser.add_argument("topic_name") + delete_parser.add_argument('topic_name') - publish_parser = subparsers.add_parser("publish", + publish_parser = subparsers.add_parser('publish', help=publish_messages.__doc__) - publish_parser.add_argument("topic_name") + publish_parser.add_argument('topic_name') publish_with_custom_attributes_parser = subparsers.add_parser( - "publish-with-custom-attributes", + 'publish-with-custom-attributes', help=publish_messages_with_custom_attributes.__doc__, ) - publish_with_custom_attributes_parser.add_argument("topic_name") + publish_with_custom_attributes_parser.add_argument('topic_name') publish_with_futures_parser = subparsers.add_parser( - "publish-with-futures", help=publish_messages_with_futures.__doc__ + 'publish-with-futures', help=publish_messages_with_futures.__doc__ ) publish_with_futures_parser.add_argument("topic_name") publish_with_error_handler_parser = subparsers.add_parser( - "publish-with-error-handler", + 'publish-with-error-handler', help=publish_messages_with_error_handler.__doc__ ) - publish_with_error_handler_parser.add_argument("topic_name") + publish_with_error_handler_parser.add_argument('topic_name') publish_with_batch_settings_parser = subparsers.add_parser( - "publish-with-batch-settings", + 'publish-with-batch-settings', help=publish_messages_with_batch_settings.__doc__ ) - publish_with_batch_settings_parser.add_argument("topic_name") + publish_with_batch_settings_parser.add_argument('topic_name') publish_with_retry_settings_parser = subparsers.add_parser( - "publish-with-retry-settings", + 'publish-with-retry-settings', help=publish_messages_with_retry_settings.__doc__ ) - publish_with_retry_settings_parser.add_argument("topic_name") + publish_with_retry_settings_parser.add_argument('topic_name') args = parser.parse_args() - if args.command == "list": + if args.command == 'list': list_topics(args.project_id) - elif args.command == "create": + elif args.command == 'create': create_topic(args.project_id, args.topic_name) - elif args.command == "delete": + elif args.command == 'delete': delete_topic(args.project_id, args.topic_name) - elif args.command == "publish": + elif args.command == 'publish': publish_messages(args.project_id, args.topic_name) - elif args.command == "publish-with-custom-attributes": + elif args.command == 'publish-with-custom-attributes': publish_messages_with_custom_attributes(args.project_id, args.topic_name) - elif args.command == "publish-with-futures": + elif args.command == 'publish-with-futures': publish_messages_with_futures(args.project_id, args.topic_name) - elif args.command == "publish-with-error-handler": + elif args.command == 'publish-with-error-handler': publish_messages_with_error_handler(args.project_id, args.topic_name) - elif args.command == "publish-with-batch-settings": + elif args.command == 'publish-with-batch-settings': publish_messages_with_batch_settings(args.project_id, args.topic_name) - elif args.command == "publish-with-retry-settings": + elif args.command == 'publish-with-retry-settings': publish_messages_with_retry_settings(args.project_id, args.topic_name) From 427071c581ac89b93e6d75dc6f9901128b2b2195 Mon Sep 17 00:00:00 2001 From: Tianzi Cai Date: Mon, 22 Jul 2019 09:39:15 -0700 Subject: [PATCH 3/4] double to single quotes --- pubsub/cloud-client/publisher.py | 56 ++++++++++++++++---------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/pubsub/cloud-client/publisher.py b/pubsub/cloud-client/publisher.py index bce5c75f9a3..2a32dc1c7f0 100644 --- a/pubsub/cloud-client/publisher.py +++ b/pubsub/cloud-client/publisher.py @@ -115,12 +115,12 @@ def publish_messages_with_custom_attributes(project_id, topic_name): topic_path = publisher.topic_path(project_id, topic_name) for n in range(1, 10): - data = u"Message number {}".format(n) + data = u'Message number {}'.format(n) # Data must be a bytestring - data = data.encode("utf-8") + 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" + topic_path, data, origin='python-sample', username='gcp' ) print(future.result()) @@ -234,34 +234,34 @@ def publish_messages_with_retry_settings(project_id, topic_name): # Configure the retry settings. Defaults will be overwritten. retry_settings = { - "interfaces": { - "google.pubsub.v1.Publisher": { - "retry_codes": { - "publish": [ - "ABORTED", - "CANCELLED", - "DEADLINE_EXCEEDED", - "INTERNAL", - "RESOURCE_EXHAUSTED", - "UNAVAILABLE", - "UNKNOWN", + 'interfaces': { + 'google.pubsub.v1.Publisher': { + 'retry_codes': { + 'publish': [ + 'ABORTED', + 'CANCELLED', + 'DEADLINE_EXCEEDED', + 'INTERNAL', + 'RESOURCE_EXHAUSTED', + 'UNAVAILABLE', + 'UNKNOWN', ] }, - "retry_params": { - "messaging": { - "initial_retry_delay_millis": 150, # default: 100 - "retry_delay_multiplier": 1.5, # default: 1.3 - "max_retry_delay_millis": 65000, # default: 60000 - "initial_rpc_timeout_millis": 25000, # default: 25000 - "rpc_timeout_multiplier": 1.0, # default: 1.0 - "max_rpc_timeout_millis": 35000, # default: 30000 - "total_timeout_millis": 650000, # default: 600000 + 'retry_params': { + 'messaging': { + 'initial_retry_delay_millis': 150, # default: 100 + 'retry_delay_multiplier': 1.5, # default: 1.3 + 'max_retry_delay_millis': 65000, # default: 60000 + 'initial_rpc_timeout_millis': 25000, # default: 25000 + 'rpc_timeout_multiplier': 1.0, # default: 1.0 + 'max_rpc_timeout_millis': 35000, # default: 30000 + 'total_timeout_millis': 650000, # default: 600000 } }, - "methods": { - "Publish": { - "retry_codes_name": "publish", - "retry_params_name": "messaging", + 'methods': { + 'Publish': { + 'retry_codes_name': 'publish', + 'retry_params_name': 'messaging', } }, } @@ -313,7 +313,7 @@ def publish_messages_with_retry_settings(project_id, topic_name): publish_with_futures_parser = subparsers.add_parser( 'publish-with-futures', help=publish_messages_with_futures.__doc__ ) - publish_with_futures_parser.add_argument("topic_name") + publish_with_futures_parser.add_argument('topic_name') publish_with_error_handler_parser = subparsers.add_parser( 'publish-with-error-handler', From ff1081276381990b3a763b73b4b6b7021645d030 Mon Sep 17 00:00:00 2001 From: Tianzi Cai Date: Mon, 22 Jul 2019 09:54:22 -0700 Subject: [PATCH 4/4] license year --- pubsub/cloud-client/iam.py | 2 +- pubsub/cloud-client/iam_test.py | 2 +- pubsub/cloud-client/publisher_test.py | 2 +- pubsub/cloud-client/quickstart.py | 2 +- pubsub/cloud-client/quickstart_test.py | 2 +- pubsub/cloud-client/subscriber.py | 2 +- pubsub/cloud-client/subscriber_test.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pubsub/cloud-client/iam.py b/pubsub/cloud-client/iam.py index bd44f1ab6e0..f9865ed3934 100644 --- a/pubsub/cloud-client/iam.py +++ b/pubsub/cloud-client/iam.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# Copyright 2016 Google Inc. All Rights Reserved. +# Copyright 2019 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/pubsub/cloud-client/iam_test.py b/pubsub/cloud-client/iam_test.py index 8a524c35a06..cfae98ffd00 100644 --- a/pubsub/cloud-client/iam_test.py +++ b/pubsub/cloud-client/iam_test.py @@ -1,4 +1,4 @@ -# Copyright 2016 Google Inc. All Rights Reserved. +# Copyright 2019 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/pubsub/cloud-client/publisher_test.py b/pubsub/cloud-client/publisher_test.py index 07a1032a5d0..b364553c2d4 100644 --- a/pubsub/cloud-client/publisher_test.py +++ b/pubsub/cloud-client/publisher_test.py @@ -1,4 +1,4 @@ -# Copyright 2016 Google Inc. All Rights Reserved. +# Copyright 2019 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/pubsub/cloud-client/quickstart.py b/pubsub/cloud-client/quickstart.py index f48d085e06b..10ff76f9b63 100644 --- a/pubsub/cloud-client/quickstart.py +++ b/pubsub/cloud-client/quickstart.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# Copyright 2016 Google Inc. All Rights Reserved. +# Copyright 2019 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/pubsub/cloud-client/quickstart_test.py b/pubsub/cloud-client/quickstart_test.py index ee6f7d4b21a..3fce09dc8f5 100644 --- a/pubsub/cloud-client/quickstart_test.py +++ b/pubsub/cloud-client/quickstart_test.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# Copyright 2018 Google Inc. All Rights Reserved. +# Copyright 2019 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/pubsub/cloud-client/subscriber.py b/pubsub/cloud-client/subscriber.py index 5802218b499..92d7791352e 100644 --- a/pubsub/cloud-client/subscriber.py +++ b/pubsub/cloud-client/subscriber.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# Copyright 2016 Google Inc. All Rights Reserved. +# Copyright 2019 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/pubsub/cloud-client/subscriber_test.py b/pubsub/cloud-client/subscriber_test.py index f91007a6dc1..2dcfb33e231 100644 --- a/pubsub/cloud-client/subscriber_test.py +++ b/pubsub/cloud-client/subscriber_test.py @@ -1,4 +1,4 @@ -# Copyright 2016 Google Inc. All Rights Reserved. +# Copyright 2019 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.