How to configure Throttling on the Vordel Gateway
How to configure Throttling on the Vordel Gateway
Join the DZone community and get the full member experience.Join For Free
Create a continuous deployment pipeline with open source tools. Watch the screencast.
If you've already registered a WSDL, skip forward to step 4.
Step 1: Open Policy Studio. Connect to the Gateway you wish to configure your policy on.
Once you connect, choose "Edit Active Configuration".
New Web Services are registered in the "Web Service Repository" which is accessed under the "Policies" group on the left-hand-side.
Step 2: Right-click on the "Web Service Repository" and choose "Register Web Service". Note that the Web Services are arranged in groups, and you can rename these groups. In the screenshot below you can see that we've created a group called "B2B Web Services".
Step 3: Select your WSDL (either via URL, file, or UDDI) and then walk through the wizard. Choose the location to deploy your virtualized service. Out of the box, there is a set of services called "Default Services" on port 8080 in , but you can rename this or change the port. You can also add a new service group (e.g. called "SSL Services") with a different listening interface (create the new services, then right-click and choose "Add interface").
Don't check the box right now to "Secure this Web Service". You'll then see a "Summary" screen in the wizard, which says what path the Virtual Service has been deployed on. Take note of this path. Press OK and then press the "Deploy" button on Policy Studio to deploy. Now open the WSDL in the browser. Note that will automatically virtualize the service hostname in the WSDL (as explained here: http://www.soatothecloud.com/2011/06/how-to-enable-service-virtualization.html ).
Step 4: Right-click on "Policies" in Policy Studio and select "Add Policy". If you already have created a contained to contain your policies, you can right-click on your container and make your policy there. Note that containers are a way to group policies together, e.g. for importing and exporting them together, but don't affect the running of the policies.
Call your new policy "Throttling"
Step 5. Drag in a "Throttling" filter, which you can find in the "Content Filtering" group. Configure with "10 messages in 1 minute" as shown in the screenshot below. Note that the Gateway must retain state for the messages, because it stores the message count. So, this is stored in a cache [called "Maximum Messages" in the screenshot]. You can add another cache, or edit the cache name, under "External Connections" in Policy Studio.
When you drag in the filter on to the policy canvas, it is initially gray because it is not being used yet. Right-click on this filter and choose "Set as start". Now it is no longer grayed out. However, it is outlined in red because it requires an input (the messages) which it is not getting at the moment. For it to get this input, it must be "wired up" to policy that is receiving a message through a listening interface.
Step 6: In Policy Studio, look under "Policies" and then "Generated Circuits" to find the service you've registered in Step 3. Double-click on the filter called "Service Handler for ''. Then open the "Message Interception Points" tab. Under "Before Operation-specific Policy" press on the "..." button to choose the policy you made in step 5 to do throttling. Once it is mapped, you should see the mapping set. Make sure you press the "Deploy" button on the Policy Studio toolbar to deploy this policy.
Step 7: Open the SOAPbox testing tooll ( a free download from here) . We will be using SOAPbox to test our throttling policy. Open the Virtual Service WSDL which you obtained from Step 3. [Tip: The Service Manager interface, under :8090/ , also allows you to see the Virtual Service WSDL, if you connect with a role which allows you to use Service Manager]. In SOAPbox , press on the import WSDL and import the Virtualized WSDL (note: not the actual WSDL from the back-end service you've registered, otherwise you'll simply send your messages to the back-end services and not through ).
Step 8: You'll see a sample message created for you in SOAPbox. Send the message through to with SOAPbox, by pressing the green triangular "play" button. Keep pressing the button until you reach the throttling limit. This message will be blocked. Note that you can customize the response message, since in a production system it is not usual to return a SOAP Fault to clients.
Step 9: View the blocked message in the Vordel Gateway's Real-Time Monitoring by pointing a browser to :8090/ and then clicking on "Real-Time Monitoring". Note that you'll have to login as a user with a role which allows viewing of Real-Time Monitoring. The screen is shown in the screenshot below:
Other steps: If you add a Distributed Cache (under "External Connections" then "caches" then "Add" in the botton-right) then you can set two or more Gateways to use the same cache. This means that if the traffic is being distributed across them, then the throttling count is cumulative over them (e.g. if 5 requests come to 1, and 5 to 2, then the value in the cache will be 10).
Published at DZone with permission of Mark O'Neill , DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.