Component for throttling functionality. 

Throttling is functionality that checks count of input requests to integration platform and if this count exceeds defined limit then new requests are restricted.

Main goal of throttling is to limit disproportionate (and often wilful) overload of integration platform with huge amount of input requests for processing. This would have bad impact to application performance and even it can stop processing of current messages.

Throttling component counts input requests from specified source (external) system and for specific operation. If this count exceeds defined limit in defined time interval then OpenHub will start to reject new input requests (only requests from specified source system and for specified operation) - exception is thrown.

Throttling configuration

Throttling configuration uses the same model as rest of OpenHub framework, see External configuration model


Throttling can be disabled at all by setting ohf.disable.throttling parameter to value true.

Suitable throttling implementation is set by ohf.throttling.counter.impl parameter. There are the following built-in implementations:

Count limits 

The default configuration (that is always added as default) is the following:

throttling.defaultInterval = 60
throttling.defaultLimit = 60

 

Use the following parameters for throttling configuration:


Parameter throttling.sourceSystem.operationName has the format limit [/interval]:

 

Examples:

throttling.crm.op1=10  (restriction to calls of operation op1 from CRM system to 10 requests for 60 seconds)

throttling.crm.*=10/40 (restriction to calls of any operation from CRM system to 10 requests for 40 seconds)

throttling.*.sendSms=60/30 (restriction to calls of operation sendSms from any system to 60 requests for 30 seconds)


Property file configuration format and example (from application.properties):

###############################################################################
#  Throttling configuration
#
#   There the following property names:
#   - throttling.defaultInterval: default time interval (in seconds) if not defined by system/operation
#   - throttling.defaultLimit: default limit if not defined by system/operation
#   - throttling.sourceSystem.operationName, where
#       - sourceSystem is specific source system or '*' if any system
#            (source system is case-insensitive value from trace header (ExternalSystemExtEnum))
#       - operationName is specific operation name or '*' if any operation
#
#   Property values (except for default values) have the following format:
#       limit [/interval]
#
#   Examples:
#       throttling.crm.op1=10
#       throttling.crm.*=10/40
#       throttling.*.sendSms=60/30
###############################################################################

throttling.defaultInterval=60
throttling.defaultLimit=60
throttling.sourceSystem.*=300/60
throttling.*.syncHello=15/60
throttling.*.asyncHello=50/60

Configuration via JMX

Throttling parameters is allowed to configured via JMX, for example with jconsole tool:

URI format

throttling:requestType[:operationName]

Options

ParameterDefaultDescription
requestType 

Specifies request type, e.g. SYNC (=synchronnous request) or ASYNC (=asynchronnous request)

Throttling component for asynchronnous request is used in route AsynchInMessageRoute for processing all input asynch. requests.

operationName operation name, e.g. "createCustomer" (mandatory for SYNC request type only)

Prerequisites

Throttling component needs reference to org.openhubframework.openhub.spi.throttling.ThrottlingProcessor that needs (in default implementation) reference to org.openhubframework.openhub.spi.throttling.ThrottlingConfiguration and org.openhubframework.openhub.spi.throttling.ThrottleCounter.

Examples

throttling:sync:sendSms
throttling:async