![]() |
Copyright © Cloud Software Group, Inc. All Rights Reserved |
A throttle T1_BookOrder is defined in such a way that the throttle T1_BookOrder allows a user to order only 20 books in 10 seconds. In such a case, a throttle T1_BookOrder is configured using the Config UI as follows:
Throttle Name: T1_BookOrder
For example, you can create a custom throttle monitor for this throttle T1_BookOrder to increment the throttle count based on the number of book orders in the request. This allows you to customize the throttle count by providing the increment counter defined as metricIncrement for the monitor. The metricIncrement for this monitor can be populated using an XPath formula based on the total number of book orders in the request message. In this case, you can define the metricIncrement to count the book orders in the request. So, if the count of book orders in a request is 5, then it increments the throttle count as 5 allowing only 4 similar requests within 10 seconds.
4. Click the MONITORS > Monitors tab.
5. Define a T1_BookOrder throttle.
Table 91 Throttle Configuration Parameters
• Specifies the name of the throttle. For example, T1_BookOrder.
−
− For example, Rate. For example, 10. For example, 20.For example, the monitor for a throttle T1 is defined in the XSLT file using a <monitor> tag as follows:
In the preceding example, the metricIncrement is assigned based on the count of the OrderDtl element in the payload of an incoming request. If you have an input payload with n number of OrderDtl elements, you can parse the number of OrderDtl elements and assign that number to metricIncrement. The metricIncrement is applied to the throttle configuration.
•
•
• If the XPath formula used in the metricIncrement field returns an invalid value, the content throttle increments the throttle count value by 1, which is the default value.This section shows the sample XML files which shows payloads with 2 Orderdetails and 4 Orderdetails. Refer to Example XSLT File for the XSLT file for these payloads.
This section shows an example XSLT file which you can use as a reference to create an XSLT file. This XSLT file illustrates how you can use the number of OrderDtl element in a payload.
After you define the XSLT file for a throttle monitor, upload the file in the New ProcessBody XSLT field on facade Operations tab in the Config UI.
4.
5. Click the Facade Operations tab on the top menu.
a. Click the Choose File button in the New ProcessBody Transform field to select the monitor XSLT transformation file.
b. Click Open button to upload the XSLT file.
![]() |
Copyright © Cloud Software Group, Inc. All Rights Reserved |