Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print actual number of messages pulled #2078

Merged
merged 2 commits into from
Aug 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pubsub/cloud-client/subscriber.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,8 @@ def synchronous_pull(project_id, subscription_name):
# Acknowledges the received messages so they will not be sent again.
subscriber.acknowledge(subscription_path, ack_ids)

print("Received and acknowledged {} messages. Done.".format(NUM_MESSAGES))
print('Received and acknowledged {} messages. Done.'.format(
len(response.received_messages)))
# [END pubsub_subscriber_sync_pull]


Expand Down Expand Up @@ -357,7 +358,8 @@ def worker(msg):
if processes:
time.sleep(SLEEP_TIME)

print("Received and acknowledged {} messages. Done.".format(NUM_MESSAGES))
print('Received and acknowledged {} messages. Done.'.format(
len(response.received_messages)))
# [END pubsub_subscriber_sync_pull_with_lease]


Expand Down