The publisher will need to be able to:
- Calculate the size of a message
- Check if a batch exceeds the limits
- Ensure that the MAX limit is not exceeded by a batch (a message cannot be added to the batch if it would make it larger than the quota limits).
See https://cloud.google.com/pubsub/docs/batch-messaging#quotas_and_limits_on_batch_messaging