Wednesday, October 16, 2019

12c OSB Throttling

What is Throttling:
Throttling is termed as "regulate the flow". Oracle Service Bus has throttling feature and by using that feature we can control number of requests sent to target service.

Why we need OSB throttling:
Every system has its own capacity means it can process only certain number of message at one time, if we try to send messages beyond its capacity then that system's performance can degrade or in worst case it can crash. So to avoid all this we can use OSB throttling feature to send limited messages to target system.

In oracle Service bus we have two approaches to resolve these kind of errors:
  • Throttling in Business Services
  • Work Managers
By using throttling in business service we can restrict the no of requests to target system.

Here I will show the Throttling setups in Business Service.
Contents:
  1. Create a Service bus application, project, proxy schema, WSDL and Proxy service.
  2. Create Business Service
  3. Create the XQUERY mapping for request response.
  4. Service callout to the created business Service and mapping request response
  5. Setup the throttling from EM console.
  6. Load test from SOAP UI tool.
Create a Service bus project, proxy schema, wsdl and Proxy service.
Click here 12c-osb-create-wsdl-proxy to know how to create service bus project, proxy wsdl and proxy service.

I have created a SOA hello World service which i will call as business wrapper service.
http://hostname:8001/soa-infra/services/POC/HelloWorldProject/helloworldlprocess_client_ep?WSDL
Create business service











Create XQUERY mapping files:













Same way create the response mapping


Service callout to the created business service and use the created request and response mappings.











Set up the throttling settings from EM console:
EM Console⇾Target Navigation⇾SOA⇾Service-bus (AdminServer)⇾Select the service bus project⇾Go to Operations tab⇾click the business service⇾Enable throttling state and Maximum Concurrency, Throttling Queue and Time to Live values for throttling.




Maximum Concurrency: The maximum number of records that the business service can process simultaneously. This value can not be 0 (zero); it must be a positive integer.
Throttling Queue: The maximum number of messages in the Throttling Queue or Throttling Queue. A value of 0 indicates that there is no Throttling Queue.
Time to Live: The number of milliseconds that a message can be in the queue before expiration. A value of 0 means that messages do not expire.

If you no longer want to limit messages for a business service, you can disable throttling for this service at any time. When you disable throttling, the messages are processed normally and the message flow is no longer limited by the throttling settings.
To disable the throttling for a business service, uncheck the Throttling state box.

Load test from SOAP UI:
Created service bus URL:
http://hostname:2001/ThrottlingSBProject/proxyServices/EmployeeProxyService?wsdl
File⇾New SOAP Project
 Put the WSDL url in the initial WSDL and give a project name
right click on the created Request⇾Add to Test case
Provide a test suite name
Provide a test case name

Right click on Load tests⇾New Load Test
Provide the Load test name
Configure the load test parameters as required. here I send 20 requests as total runs.
 You can see 3 requests hit the service at a time.

No comments:

Post a Comment

Featured Post

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...