|
this.sizeBytesToRequest.addAndGet(responseBytesSize); |
The backpressure API in topics allows to specify the amount of memory that server can fill with messages. Server can send a bit more (less than a single message size). So, we can increase this variable sizeBytesToRequest several times and actual amount of requested memory can slowly increase. Read session must not send sizeBytesToRequest greater that MaxMemoryUsageBytes. Adeally, it must send to server MaxMemoryUsageBytes - usedBytes, where usedBytes is the amount of bytes used by the session.