How is the maxbyte property supposed to work?

2k views Asked by At

according the documentation tor TIBCO EMS

"For queues, maxbytes defines the maximum size (in bytes) that the queue can store, summed over all messages in the queue. Should this limit be exceeded, messages will be rejected by the server and the message producer send calls will return an error."

Currently one of our queues have maxbytes set to 500000000 but the pending msgs size is much higher, 2.5GB

How can this be possible?

Thanks!

2

There are 2 answers

0
Nicolas Heitz On

One possible explanation is that the maxbytes property only pertains to undelivered pending messages. It means that messages that have been delivered but not yet acknowledged by the JMS consumer(s) are not taken into account in the calculation of the maxbytes property.

When you issue show queue <queue_name> with the EMS administration tool, does the Delivered Msgs value seem particularly high?

0
user955732 On

What Nicolas Heitz is saying seems to be correct.

I ran a simple test locally to reproduce this, using TIBCO Designer to send and receive large messages with approx 4Mb size and a queue configured with maxbytes set to 100Kb,

This is what the queue looked like before the test started: enter image description here

First scenario, no receivers on the queue.

It was possible to send one 4MB message to the queue, but any message after this fails.

enter image description here

Second scenario, one receiver not acknowledging messages

Starting point, one 4MB pending message on the queue

Sending a second message works enter image description here

It appears to be possible to keep sending messages, as long as there is an active receiver on the queue processing messages without having acknowledged them yet.

enter image description here

Conclusion

In case of a slow consumer not acknowledging the messages it receives fast enough, maxbytes will not limit the pending msgs size on a queue.

If there is no consumer on the queue, then maxbytes will be checked before a message is sent, and if the limit is reached, the message producer will receive an error from the ems server an no new messages can be sent.

The maxbytes property is not blocking a message larger than maxbytes from being sent to the queue.