Pre-ACK will be called when the server is delivering the message to the client.
The message may go to the client buffer... at that point if you don't consume your client's buffer, the buffer may be up to its maximum size (consumer-window-size) and messages will be then batched at the server.
You should consume messages if you want to have more messages delivered. Or you could also set consumerWindowSize=-1.. but you could eventually OutMememoryException at the client if you don't consume your buffer.
Actually, I have a quick follow-up question:
The details of my system configuration remain the same:
- I have configured HornetQ for "Pre-ACK" mode.
- I have disabled the Expiry Queue.
- I have a non-durable subscriber that subscribes to a topic but does not ever call receive(). Instead, the subscriber is busy doing other work.
Under these constraints, I'm playing around with different <consumer_window_size> values. The resulting behavior is strange: the true client buffer size appears to be less than half of whatever I specify in the consumer_window_size field.
For example, if I specify <consumer-window-size>5242880</consumer-window-size> (5MB), I see the server-side queues start filling up after a publisher pushes approx 2.1 MB of message data. These results are consistent with just about any non-negative value I try for <consumer-window-size>. Any idea what's going on here?
(P.S: Setting consumer_window_size = -1 appears to work correctly. In this case, I never see any messages get buffered at the server)
The size is based on the wiring size / size of the buffer. Maybe you're using a different counting for your message size?
The thing will be basically taken of Consumer credits and the wire protocol.