2

In later versions of the Google PubSub client Java API, they have added a maxOutstandingElementCount value which defaults to 1000.

maxOutstandingElementCount -- The maximum number of elements that can be outstanding before data flow is restricted, or null if there is no specified limit.

We are using PubSub in a transactional system and are trying to only acknowledge the messages at a certain point in the future when the transactions have been globally committed. The problem is that we don't always know beforehand the number of records that we want to be outstanding since the transactions can be based on time or customer logic.

Question: What are the ramifications of setting the max-outstanding value to be null or some large integer? Does this only impact client side memory storage of outstanding GUIDs or other telemetry? Anything else we need to worry about?

We already have our own flow-control since the receiver threads write to bounded blocking queues but we may have 10k or even 100k outstanding messages depending on client settings and we want to make sure that setting max-outstanding to null is valid.

Thanks for any information.

Gray
  • 115,027
  • 24
  • 293
  • 354

1 Answers1

0

Setting maxOutstandingElementCount to null or not using flow control, more outstanding messages continue to consume memory, CPU, and bandwidth resources. As such, it might cause out-of-memory issues on subscriber clients. It shouldn't impact anything more than subscriber clients.

Since you are using your own flow control, then Google managed flow control can be overridden.

Gray
  • 115,027
  • 24
  • 293
  • 354
Jinjun
  • 381
  • 2
  • 11