As soon as you consumed messages.. and Acked messages.. that's when the producer will released.. you have to consume and ack messages (not just consume)
I'm using AUTO_ACKNOWLEDGE...
Maybe you have a dead subscription? what won't free up space whatsoever.
Also... take the latest versions.
Sorry, I wasn't very clear in my original description... let me clarify:
Messages *are* being cleared from the address and the block *is* being released. In general, the overall behavior is exacly what it should be (and is what I expected).
The only confusion I have is that messages appear to be cleared in "chunks":
Suppose that <max-size-bytes> is such that it can hold 100 homogeneous messages. When the producer goes to write the 101st message, the space is full and the producer gets blocked (as expected).
I then start the consumer (which reads at a slower rate than the producer). After the consumer reads one message, my expectation is that there would now be space for one message in the queue so that the block should free, and the producer would be able to write the 101st message (and then get blocked writing the 102nd message, etc.)
However, what I'm seeing is that when I start the consumer, it reads not one, but a "chunk" of messages (say 15) before the block gets released. (At which point the producer is able to write another 15 messages or so until it is blocked again).
So my question is: why does it require that 15 messages (instead of one) be read in order for the block to be released, as the messages are all exactly the same size.
Thank you very much
Take a look at the consumer Window Size and producer Window Size. They also play on how these things are sent between server and client. You probably need a smaller producer window size if you want an earlier release.
Thanks Clebert. This is exactly what I was looking for. Setting the producer-window-size to -1 gives the behavior that I was expecting.
is it still blocking with -1? because I think with -1 you are basicall disabling flow control at the producer. I was expecting 0 to work... but I may be wrong... too much stuff to remember now
Yes, with -1 you're disabling producer flow control (a producer-window-size of 0 is not valid and causes an error to be logged).
I think that with producer flow control enabled, the server will never send back more credits than would cause the max-size-bytes limit to be exceeded. So either the server is not releasing the block until producer-window-size credits have been made available, or it's releasing the block, but not (initially) sending back enough credits for the producer to add another message. Does this make sense?