In the previous section we have seen how it is possible to limit the Windows buffer size and the maximum rate of the messages consumed within a queue, at least using the JMS specification.
But considering that the clients are the ones that send messages, it is possible that they can potentially block the consumer by sending too many messages. HornetQ provides some parameters from the producer's side so that it is possible to manage the number of messages sent to the queues.
HornetQ offers the same possibilities that we have seen from the consumer layer to the producer layer.
In our example, all the medical messages sent to the ECGQueue
in general are not of a fixed size. HornetQ offers the possibility to set the maximum size of memory, so as to limit the maximum size of the messages, sent from any producer to the specific queue, to a fixed value.
In this case, when the threshold value is reached, the producer receives a block on their side waiting for the memory...