1. Help Center
  2. Troubleshooting

Message Queue Limit Reached

This article will guide you through a potential cause and the respective solution to the MESSAGE_QUEUE_LIMIT_REACHED notification. 

Problem

Sessions are being closed by the server and the following PUSH-000046 message appears in the log.

  |INFO|InboundThreadPool Thread_1|PUSH-000046|Client 1fa94yd6ce8461-0000000000001
closing - MESSAGE_QUEUE_LIMIT_REACHED.

Cause

Each connected session has its own message queue for messages from the server to the client. Each queue has limits, measured in number of messages and/or size in bytes, which can be set by the user. If the client has filled its queue the Diffusion server closes the session. 

The following scenarios may cause the message queue to fill:

(1) A client is subscribing to more topics than the queue can handle i.e. too much data is going into the queue. 

(2) A client is not consuming topics quickly enough, potentially due to low bandwidth i.e. not enough data is being taken out of the queue. 

Additionally, JavaScript clients cannot currently close their session when the page/window/browser is closed, so they will either cause MESSAGE_QUEUE_LIMIT_REACHED or CLIENT_UNRESPONSIVE (because they did not respond to a ping from the server soon enough).

Resolution

The maximum queue depth for clients can be configured for a client connector in etc/Connectors.xml. A default value can also be configured in etc/Server.xml for connectors that do not explicitly specify a value.

Message Queue Limit Reached_image_1

The maximum queue depth must be chosen carefully as a large size might lead to excessive memory usage and vulnerability to Denial of Service attacks, whilst a small size can lead to slow clients being disconnected too frequently.

By default, Connectors.xml contains a "High Volume Connector" profile which you can use for high volume clients. If the High Volume Client intends to subscribe to 1 million topics, then that queue needs to be some multiple of 1 million items large. You should tune the profile based on testing for your particular requirements.

For more information on performance and resilience see: Tuning.