Description

Returns the current size of the ColdFusion event queue that handles all messages for all gateways.

Category

Event Gateway Development

Syntax

int getQueueSize()

See also

addEventgetMaxQueueSize

Returns

The integer number of messages in the gateway message queue that are waiting to be delivered to CFCs.

Usage

You can use this method and the getMaxQueueSize method to control the rate of event queuing and to help diagnose any throughput problems in your gateways.

Example

The following example logs the queue size, maximum queue size, and other information if a gatewayService.addEvent method fails to queue a message for delivery to a listener CFC. (It uses an internal method to construct the error message string.)

boolean sent = gatewayService.addEvent(cfmsg);
if (!sent)
{
logger.error(RB.getString(this, "IMGateway.cantAddToQueue",
gatewayType, gatewayID, ((path != null) ? path : "default"),
Integer.ToString(gatewayService.getQueueSize()),
Integer.ToString(gatewayService.getMaxQueueSize())));
}

 

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy