Trying to understand Consumer Ack Window

There is a lot of confusion here. We could do a better job communicating this.

A client acknowledgement merely signal to the broker the message has been received and processed and can now be deleted from the endpoint (topic endpoint or queue). If the message is no longer on any endpoints it is removed from the message spool.

It is not flow control. Withholding acknowledgements will not stop the broker from sending more messages. You can simulate flow control by reducing MAX_UNACKNOWLEDGED_MESSSAGES on the endpoint to a point where the application can stop message flow by withholding acknowledgements. However that is a blunt hammer to solve this. MAX_UNACKNOWLEDGED_MESSAGES is intended to prevent one receiver from consuming too many resources. It is not intended for flow control.

API, or transport, acknowledgements are the flow control mechanism. JCSMP will only allow up to the defined window size (255 by default) + 1 message to be queued on it’s receive queue. There will be never more than that many messages in flight at a time as you desire. If you do not call Consumer.receive(), because the application is busy doing other things, then the API will start withholding acknowledgements and reducing the transport window automatically on your behalf.