Class DefaultRateThrottlingPolicyHeaplet

  • All Implemented Interfaces:
    Heaplet

    public class DefaultRateThrottlingPolicyHeaplet
    extends GenericHeaplet
    Creates and initializes a DefaultRateThrottlingPolicy in a heap environment. Configuration options:
     
     {
         "type": "DefaultRateThrottlingPolicy",
         "config": {
             "delegateThrottlingRatePolicy"  : reference or               [REQUIRED - the policy that will define the
                                               inlined declaration                    throttling rate to apply]
             "defaultRate" {                 : reference                  [OPTIONAL - the default rate to apply if
                                                                                      the delegated throttling rate
                                                                                      policy returns no rate to apply]
                    "numberOfRequests"             : integer              [REQUIRED - The number of requests allowed
                                                                                      to go through this filter during
                                                                                      the duration window.]
                    "duration"                     : duration             [REQUIRED - The time window during which the
                                                                                      incoming requests are counted.]
             }
         }
     }
     
     
    Example : it applies a rate of 15 requests / sec if the scripted throttling rate policy returns no rate.
     
     {
         "type": "DefaultRateThrottlingPolicy",
         "config": {
             "delegateThrottlingRatePolicy" : "customThrottlingRatePolicy"
             "defaultRate" : {
                 "numberOfRequests" : 15,
                 "duration" : "1 sec"
             }
         }
     }
     
     
    • Constructor Detail

      • DefaultRateThrottlingPolicyHeaplet

        public DefaultRateThrottlingPolicyHeaplet()
    • Method Detail