Flow control
A client application rapidly making thousands of calls to Diffusion™ Cloud might overflow the internal queues for the client, which results in that client session being closed. Flow control automatically protects against these queues overflowing by progressively delaying messages from the client to Diffusion Cloud .
Supported platforms: Android™ , Java™ , .NET, and C
- The outbound queue on the client where messages are queued to be sent to Diffusion Cloud
- The queue on Diffusion Cloud where responses to service requests are queued.
Flow control is intended to benefit those clients that send a lot of data to Diffusion Cloud – for example, updates to publish to topics. Usually, these clients are those located in the back-end of your solution that perform control functions.
When is flow control enabled?
- Depth of the outbound client queue
- The number of pending responses to service requests
- Whether the current active thread is a callback thread
Flow control introduces sleeps into the client processing. The length of these sleeps depends on the value of the back pressure. The maximum amount of delay introduced into client processing by flow control is 100 ms. The amount of delay introduced by flow control might be subject to change in future releases.
The flow control behavior of a client cannot be configured.
How to tell that flow control is enabled
2016-09-26 11:15:48,344 DEBUG [PushConnectorPool-thread-18] c.p.d.f.SleepingFlowControl(apply) - pressure=1.0 => sleep for 100 ms
The log message includes the current back pressure and the length of delay introduced.
The C client does not log its flow control behavior.