11

What is the difference between topic/send_message_operation_count and topic/send_request_count in google pubsub.

The requirement is though i can calculate no.of messages present in subscriber by undeliver_messages but I need to calculate how many messages are pushed to the topic.

Thanks, Santosh

santosh.a
  • 503
  • 5
  • 20
  • hey Santosh.a I would like to know how did you calculate the number of messages in a subscription using this method. I have came across a similar issue getting an accurate count of messages. – Malcode May 06 '22 at 20:15

1 Answers1

8

The docs for topic/send_message_operation_count say:

Cumulative count of publish message operations, grouped by result.

The docs for topic/send_request_count say:

Cumulative count of publish requests, grouped by result.

Pub/Sub allows multiple messages to be batched in a single API request. send_request_count is the number of publish API calls, while send_message_operation_count is the number of actual messages in those calls.

So if on average each request sends 10 messages, send_message_operation_count will be 10x send_request_count. If you publish one message per API call, they will be the same.

David
  • 9,288
  • 1
  • 20
  • 52